Class: Octopress::Social::Facebook::Tag
- Inherits:
-
Liquid::Tag
- Object
- Liquid::Tag
- Octopress::Social::Facebook::Tag
- Defined in:
- lib/octopress-social/facebook.rb
Instance Method Summary collapse
-
#initialize(tag, input, tokens) ⇒ Tag
constructor
A new instance of Tag.
- #render(context) ⇒ Object
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 |