Class: Zippopotamus::Place
- Inherits:
-
Object
- Object
- Zippopotamus::Place
- Defined in:
- lib/zippopotamus/place.rb
Instance Method Summary collapse
- #[](key) ⇒ Object
-
#initialize(values = {}) ⇒ Place
constructor
A new instance of Place.
- #inspect ⇒ Object
- #to_s ⇒ Object
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 |
#inspect ⇒ Object
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_s ⇒ Object
14 15 16 |
# File 'lib/zippopotamus/place.rb', line 14 def to_s JSON.pretty_generate(@values) end |