Class: PostCode

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

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#dataObject (readonly)

Returns the value of attribute data.



4
5
6
# File 'lib/posty.rb', line 4

def data
  @data
end