Class: Shareable::Helpers::Reddit

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:


93
94
95
96
97
98
99
100
101
102
103
104
105
# File 'lib/shareable/helpers/tags.rb', line 93

def to_s(locals={}) #:nodoc:
  if (@options[:options][:static_link] && !(@options[:reddit] && @options[:reddit][:static_link]==false)) || (@options[:reddit] && @options[:reddit][: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[:reddit]
      @options[:reddit][:title] = CGI::escape(@options[:reddit][:title]) if @options[:reddit][:title]
      @options[:reddit][:url] = CGI::escape(@options[:reddit][:url]) if @options[:reddit][:url]
    end
  end
  super locals, "Reddit"
end