Class: Octopress::Social::GooglePlus::Tag
- Inherits:
-
Liquid::Tag
- Object
- Liquid::Tag
- Octopress::Social::GooglePlus::Tag
- Defined in:
- lib/octopress-social/google-plus.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.
86 87 88 89 |
# File 'lib/octopress-social/google-plus.rb', line 86 def initialize(tag, input, tokens) @tag = tag.strip @input = input.strip end |
Instance Method Details
#render(context) ⇒ Object
91 92 93 94 95 96 97 |
# File 'lib/octopress-social/google-plus.rb', line 91 def render(context) item = context[@input] || context['page'] site = context['site'] Octopress::Social::GooglePlus.config(site) Octopress::Social::GooglePlus.send(@tag, site, item).gsub(/(\s{2,}|\n)/, ' ').strip end |