Class: PostCode
- Inherits:
-
Object
- Object
- PostCode
- Defined in:
- lib/posty.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
Instance Method Summary collapse
-
#initialize(data) ⇒ PostCode
constructor
A new instance of PostCode.
Constructor Details
#initialize(data) ⇒ PostCode
Returns a new instance of PostCode.
5 6 7 8 9 10 11 12 13 |
# File 'lib/posty.rb', line 5 def initialize data @data = {} data.each_pair do |a,b| @data[a] = b if a.is_a? String end @data['latitude'] = @data['latitude'].to_f @data['longitude'] = @data['longitude'].to_f end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
4 5 6 |
# File 'lib/posty.rb', line 4 def data @data end |