Class: Shareable::Helpers::Socialize

Inherits:
Tag
  • Object
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 = {}, caption = "") ⇒ Object

:nodoc:


15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/shareable/helpers/tags.rb', line 15

def to_s(locals={}, caption="") #:nodoc:
  locals[:options] ||= {}
  social_site=(locals[:options][:button_name]=self.class.name.demodulize.underscore.downcase).to_sym
  locals[:options][:button_caption] = caption
  if @options[:options]
    @options[:filtered] ||= @options[:options].reject {|opt| locals[:options].include?(opt)}
    locals[:options].merge!(@options[:filtered])
  end
  if @options[social_site]
    locals[:options].merge!(@options[social_site])
  end
  super locals
end