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

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

Instance Method Summary collapse

Constructor Details

#initialize(request, icon_settings) ⇒ Stacked

Returns a new instance of Stacked.



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

def initialize( request , icon_settings )
  raise unless icon_settings.instance_of?( ::Array )
  raise unless icon_settings.length == 2
  raise unless icon_settings.all? { | item | item.instance_of?( ::Hash ) }
  raise unless icon_settings.all? { | item | item.keys.include?( :icon_name ) }
  raise unless icon_settings.all? { | item | item.keys.include?( :size ) }

  super( request )
  @icon_settings = icon_settings
end

Instance Method Details

#renderObject



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

def render
  h.render inline: <<-HAML , type: :haml , locals: h_locals
%span{ class: [ "fa-stack" , "fa-lg" ] }
- icon_settings.each do | icon |
  = ::TokyoMetro::App::Renderer::Icon.send( icon[ :icon_name ] , request , icon[ :size ] , spin: icon[ :spin ] , pulse: icon[ :pulse ] , inverse: icon[ :inverse ] ).render
  HAML
end