Class: Octopress::Social::Facebook::Tag

Inherits:
Liquid::Tag
  • Object
show all
Defined in:
lib/octopress-social/facebook.rb

Instance Method Summary collapse

Constructor Details

#initialize(tag, input, tokens) ⇒ Tag

Returns a new instance of Tag.



139
140
141
142
# File 'lib/octopress-social/facebook.rb', line 139

def initialize(tag, input, tokens)
  @tag = tag.strip
  @input = input.strip
end

Instance Method Details

#render(context) ⇒ Object



144
145
146
147
148
149
150
151
# File 'lib/octopress-social/facebook.rb', line 144

def render(context)
  item = Octopress::Social.item(context, @input)
  site = context['site']

  Octopress::Social::Facebook.set_url(site, item)
  Octopress::Social::Facebook.set_config(site)
  Octopress::Social::Facebook.send(@tag, site, item).gsub(/(\s{2,}|\n)/, ' ').strip
end