Class: Booth::ToStruct
Overview
Converts a Hash to a Data object.
Instance Method Summary collapse
Instance Method Details
#call ⇒ Object
10 11 12 13 14 15 16 |
# File 'lib/booth/to_struct.rb', line 10 def call ::Data.define(*attributes.keys) do def self.inspect "<Data :#{members.join(', :')}>" end end.new(**attributes) end |