Class: TokyoMetro::App::Renderer::ColorBox

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

Instance Method Summary collapse

Constructor Details

#initialize(request, class_name: nil, size: :normal, text: nil) ⇒ ColorBox

Returns a new instance of ColorBox.



3
4
5
6
7
# File 'lib/tokyo_metro/app/renderer/color_box.rb', line 3

def initialize( request , class_name: nil , size: :normal , text: nil )
  super( request )
  @class_name = set_class_name( class_name , size )
  @text = text
end

Instance Method Details

#renderObject



9
10
11
12
13
14
15
# File 'lib/tokyo_metro/app/renderer/color_box.rb', line 9

def render
  h.render inline: <<-HAML , type: :haml , locals: h_locals
%div{ class: class_name }<
- if text.present?
  = text
  HAML
end