Module: ParkInfo::ActAsBag
Instance Method Summary
collapse
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method_name, *args, &block) ⇒ Object
8
9
10
11
12
13
14
|
# File 'lib/park_info.rb', line 8
def method_missing(method_name, *args, &block)
if @data && @data.has_key?(method_name.to_s)
@data[method_name.to_s]
else
super
end
end
|
Instance Method Details
#keys ⇒ Object
16
17
18
|
# File 'lib/park_info.rb', line 16
def keys
@data.nil? ? [] : @data.keys
end
|