Class: SAFT::V2::HTML::RenderHash
- Inherits:
-
Object
- Object
- SAFT::V2::HTML::RenderHash
- Defined in:
- lib/saft/v2/html.rb
Instance Method Summary collapse
-
#initialize(hash) ⇒ RenderHash
constructor
A new instance of RenderHash.
- #to_tubby ⇒ Object
Constructor Details
#initialize(hash) ⇒ RenderHash
Returns a new instance of RenderHash.
175 176 177 |
# File 'lib/saft/v2/html.rb', line 175 def initialize(hash) @hash = hash.select { |_, value| value } end |
Instance Method Details
#to_tubby ⇒ Object
179 180 181 182 183 184 185 186 187 188 |
# File 'lib/saft/v2/html.rb', line 179 def to_tubby Tubby.new { |t| @hash.each do |key, value| t.div { t.strong("#{key.to_s.tr("_", " ").capitalize} ") t << value } end } end |