Class: ParkInfo::Bag

Inherits:
Object
  • Object
show all
Includes:
ActAsBag
Defined in:
lib/park_info.rb

Instance Method Summary collapse

Methods included from ActAsBag

#keys, #method_missing

Constructor Details

#initialize(data) ⇒ Bag

Returns a new instance of Bag.



24
25
26
27
28
29
30
31
# File 'lib/park_info.rb', line 24

def initialize(data)
    data.each do |key, val|
        if val.is_a? Hash
            data[key] = Bag.new(val)
        end
    end
    @data = data
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class ParkInfo::ActAsBag