Module: TopHat::TwitterCardHelper

Defined in:
lib/tophat/twitter_card.rb

Defined Under Namespace

Classes: TwitterCardGenerator

Instance Method Summary collapse

Instance Method Details

#twitter_card(type = nil, &block) ⇒ Object



41
42
43
44
45
46
47
48
49
# File 'lib/tophat/twitter_card.rb', line 41

def twitter_card(type=nil, &block)
  if type.nil?
    if TopHat.current['twitter_card']
      TopHat.current['twitter_card'].render
    end
  else
    TopHat.current['twitter_card'] = TwitterCardGenerator.new(type, &block)
  end
end