Class: SmartyStreets::USReverseGeo::Coordinate

Inherits:
Object
  • Object
show all
Defined in:
lib/smartystreets_ruby_sdk/us_reverse_geo/coordinate.rb

Overview

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(obj) ⇒ Coordinate

Returns a new instance of Coordinate.



7
8
9
10
11
12
# File 'lib/smartystreets_ruby_sdk/us_reverse_geo/coordinate.rb', line 7

def initialize(obj)
  @latitude = obj.fetch('latitude', nil)
  @longitude = obj.fetch('longitude', nil)
  @accuracy = obj.fetch('accuracy', nil)
  @license = obj.fetch('license', nil)
end

Instance Attribute Details

#accuracyObject (readonly)

Returns the value of attribute accuracy.



5
6
7
# File 'lib/smartystreets_ruby_sdk/us_reverse_geo/coordinate.rb', line 5

def accuracy
  @accuracy
end

#latitudeObject (readonly)

Returns the value of attribute latitude.



5
6
7
# File 'lib/smartystreets_ruby_sdk/us_reverse_geo/coordinate.rb', line 5

def latitude
  @latitude
end

#licenseObject (readonly)

Returns the value of attribute license.



5
6
7
# File 'lib/smartystreets_ruby_sdk/us_reverse_geo/coordinate.rb', line 5

def license
  @license
end

#longitudeObject (readonly)

Returns the value of attribute longitude.



5
6
7
# File 'lib/smartystreets_ruby_sdk/us_reverse_geo/coordinate.rb', line 5

def longitude
  @longitude
end

Instance Method Details

#get_licenseObject



14
15
16
17
18
19
20
21
# File 'lib/smartystreets_ruby_sdk/us_reverse_geo/coordinate.rb', line 14

def get_license()
  case @license
  when 1
    return "SmartyStreets Proprietary"
  else
    return "SmartyStreets"
  end
end