Class: TokyoMetro::App::Renderer::Icon::FontAwesome

Inherits:
Factory::Decorate::MetaClass show all
Defined in:
lib/tokyo_metro/app/renderer/icon/font_awesome.rb

Defined Under Namespace

Classes: Stacked

Instance Method Summary collapse

Constructor Details

#initialize(request, icon_name, size = 1, spin: nil, pulse: nil, inverse: nil) ⇒ FontAwesome

Returns a new instance of FontAwesome.



3
4
5
6
7
8
9
10
11
12
# File 'lib/tokyo_metro/app/renderer/icon/font_awesome.rb', line 3

def initialize( request , icon_name , size = 1 , spin: nil , pulse: nil , inverse: nil )
  raise if spin and pulse
  raise "Error" if ( spin or pulse ) and !( [ "circle-o-notch" , "cog" , "gear" , "refresh" , "spinner" ].include?( icon_name ) )
  super( request )
  @icon_name = icon_name
  @size = size
  @spin = spin
  @pulse = pulse
  @inverse = inverse
end

Instance Method Details

#renderObject



14
15
16
17
18
# File 'lib/tokyo_metro/app/renderer/icon/font_awesome.rb', line 14

def render
  h.render inline: <<-HAML , type: :haml , locals: h_locals
= content_tag( :i , "" , class: classes )
  HAML
end