Class: Shareable::Helpers::Pinterest

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:


77
78
79
80
81
82
83
84
85
86
87
88
89
# File 'lib/shareable/helpers/tags.rb', line 77

def to_s(locals={}) #:nodoc:
  locals[:options] ||= {}
  p_opts = {:description => CGI::escape(@options[:options][:description]),
            :url => CGI::escape(@options[:options][:url]),
            :media => CGI::escape(@options[:options][:media])}
  locals[:options].merge!(@options[:options].merge(p_opts))
  if @options[:pinterest]
    @options[:pinterest][:description] = CGI::escape(@options[:pinterest][:description]) if @options[:pinterest][:description]
    @options[:pinterest][:url] = CGI::escape(@options[:pinterest][:url]) if @options[:pinterest][:url]
    @options[:pinterest][:media] = CGI::escape(@options[:pinterest][:media]) if @options[:pinterest][:media]
  end
  super locals, "Pinterest"
end