Class: TokyoMetro::App::Renderer::Icon::FontAwesome
- Inherits:
-
Factory::Decorate::MetaClass
- Object
- RailsDecorateFactory
- Factory::Decorate::MetaClass
- TokyoMetro::App::Renderer::Icon::FontAwesome
- Defined in:
- lib/tokyo_metro/app/renderer/icon/font_awesome.rb
Defined Under Namespace
Classes: Stacked
Instance Method Summary collapse
-
#initialize(request, icon_name, size = 1, spin: nil, pulse: nil, inverse: nil) ⇒ FontAwesome
constructor
A new instance of FontAwesome.
- #render ⇒ Object
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
#render ⇒ Object
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 |