Sha256: bf110b4f3774959940749494a7e6a3486087f2933707e92380244a52196f1aea

Contents?: true

Size: 1.35 KB

Versions: 1

Compression:

Stored size: 1.35 KB

Contents

class TokyoMetro::App::Renderer::Concerns::Header::Title < TokyoMetro::App::Renderer::Concerns::Header::MetaClass

  def initialize(
    request , text_ja , text_en ,
    domain_id_name: nil ,
    domain_class_name: nil ,
    icon_name: nil ,
    icon_size: 3 ,
    additional_content: nil
  )
    super(
    request , text_ja , text_en ,
    domain_id_name: domain_id_name ,
    domain_class_name: domain_class_name ,
    additional_content: additional_content
  )

    @icon_name = icon_name
    @icon_size = icon_size
  end

  def render
    h.render inline: <<-HAML , type: :haml , locals: h_locals

- if domain_id_name.present?

  %div{ id: domain_id_name , class: domain_class_name }
    = ::TokyoMetro::App::Renderer::Concerns::Header::Title::Base.new( request , text_ja , text_en ).render
    = ::TokyoMetro::App::Renderer::Concerns::Header::Title::Top.new( request ).render
    - if additional_content.present?
      = additional_content.call

- else
  %div{ class: :common }
    = ::TokyoMetro::App::Renderer::Concerns::Header::Title::Base.new( request , text_ja , text_en ).render
  = ::TokyoMetro::App::Renderer::Concerns::Header::Title::Top.new( request ).render
  - if additional_content.present?
    = additional_content.call

    HAML
  end

  private

  def h_locals
    super.merge({
      icon_name: @icon_name ,
      icon_size: @icon_size
    })
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
tokyo_metro-0.10.1 lib/tokyo_metro/app/renderer/concerns/header/title.rb