Class: Zippopotamus::Place

Inherits:
Object
  • Object
show all
Defined in:
lib/zippopotamus/place.rb

Instance Method Summary collapse

Constructor Details

#initialize(values = {}) ⇒ Place

Returns a new instance of Place.



5
6
7
8
# File 'lib/zippopotamus/place.rb', line 5

def initialize(values = {})
  @values = values
  add_readers(values.keys)
end

Instance Method Details

#[](key) ⇒ Object



10
11
12
# File 'lib/zippopotamus/place.rb', line 10

def [](key)
  @values[key.to_s.downcase.gsub("_", " ")]
end

#inspectObject



18
19
20
# File 'lib/zippopotamus/place.rb', line 18

def inspect
  "#<#{self.class}:0x#{self.object_id.to_s(16)}> JSON: " + to_s
end

#to_sObject



14
15
16
# File 'lib/zippopotamus/place.rb', line 14

def to_s
  JSON.pretty_generate(@values)
end