Class: Shareable::Helpers::StumbleUpon

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:


109
110
111
112
113
114
115
116
117
118
119
120
121
# File 'lib/shareable/helpers/tags.rb', line 109

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