Class: Octopress::Social::Twitter::Tweet

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

Instance Method Summary collapse

Constructor Details

#initialize(tag, input, tokens) ⇒ Tweet

Returns a new instance of Tweet.



115
116
117
118
119
# File 'lib/octopress-social/twitter.rb', line 115

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

Instance Method Details

#render(context) ⇒ Object



121
122
123
124
125
126
# File 'lib/octopress-social/twitter.rb', line 121

def render(context)
  content = super(context)
  site = context['site']
  item = context['page']
  Octopress::Social::Twitter.tweet(site, item, @input, content).gsub(/(\s{2,}|\n)/, ' ').strip
end