Class: SAFT::V2::HTML::RenderHash

Inherits:
Object
  • Object
show all
Defined in:
lib/saft/v2/html.rb

Instance Method Summary collapse

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_tubbyObject



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