Class: Shareable::Helpers::Linkedin

Inherits:
Socialize show all
Defined in:
lib/shareable/helpers/tags.rb

Instance Method Summary collapse

Methods inherited from Tag

#initialize

Constructor Details

This class inherits a constructor from Shareable::Helpers::Tag

Instance Method Details

#to_s(locals = {}) ⇒ Object

:nodoc:


59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# File 'lib/shareable/helpers/tags.rb', line 59

def to_s(locals={}) #:nodoc:
  if (@options[:options][:static_link] && !(@options[:linkedin] && @options[:linkedin][:static_link]==false)) || (@options[:linkedin] && @options[:linkedin][:static_link])
    locals[:options] ||= {}
    p_opts = {:description => CGI::escape(@options[:options][:description]),
              :title => CGI::escape(@options[:options][:title]),
              :url => CGI::escape(@options[:options][:url])}
    locals[:options].merge!(@options[:options].merge(p_opts))
    if @options[:linkedin]
      @options[:linkedin][:description] = CGI::escape(@options[:linkedin][:description]) if @options[:linkedin][:description]
      @options[:linkedin][:title] = CGI::escape(@options[:linkedin][:title]) if @options[:linkedin][:title]
      @options[:linkedin][:url] = CGI::escape(@options[:linkedin][:url]) if @options[:linkedin][:url]
    end
  end
  super locals, "LinkedIn"
end