Class: TokyoMetro::App::Renderer::ColorBox
- Inherits:
-
Factory::Decorate::MetaClass
- Object
- RailsDecorateFactory
- Factory::Decorate::MetaClass
- TokyoMetro::App::Renderer::ColorBox
- Defined in:
- lib/tokyo_metro/app/renderer/color_box.rb
Instance Method Summary collapse
-
#initialize(request, class_name: nil, size: :normal, text: nil) ⇒ ColorBox
constructor
A new instance of ColorBox.
- #render ⇒ Object
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
#render ⇒ Object
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 |