Sha256: 449f397d7bebc961a93c6d1cff7aad6039bac7f4a61b9533ac6af95722fabed6

Contents?: true

Size: 986 Bytes

Versions: 1

Compression:

Stored size: 986 Bytes

Contents

class TokyoMetro::App::Renderer::Icon::FontAwesome::Stacked < TokyoMetro::Factory::Decorate::MetaClass

  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

  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

  private

  def h_locals
    super().merge({
      icon_settings: @icon_settings
    })
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
tokyo_metro-0.10.1 lib/tokyo_metro/app/renderer/icon/font_awesome/stacked.rb