Class: WeatherSage::Census::Match
- Inherits:
-
Object
- Object
- WeatherSage::Census::Match
- Defined in:
- lib/weather-sage/census/match.rb
Overview
Matching address returned by Geocoder.
Instance Attribute Summary collapse
-
#address ⇒ Object
readonly
Returns the value of attribute address.
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#point ⇒ Object
readonly
Returns the value of attribute point.
Instance Method Summary collapse
-
#initialize(ctx, data) ⇒ Match
constructor
Create a new Match object.
Constructor Details
#initialize(ctx, data) ⇒ Match
Create a new Match object.
10 11 12 13 14 15 16 17 18 |
# File 'lib/weather-sage/census/match.rb', line 10 def initialize(ctx, data) # get coordinates x, y = %w{x y}.map { |k| data['coordinates'][k] } # cache data, address, and point @data = data.freeze @address = @data['matchedAddress'] @point = ::WeatherSage::Weather::Point.new(ctx, x, y).freeze end |
Instance Attribute Details
#address ⇒ Object (readonly)
Returns the value of attribute address.
5 6 7 |
# File 'lib/weather-sage/census/match.rb', line 5 def address @address end |
#data ⇒ Object (readonly)
Returns the value of attribute data.
5 6 7 |
# File 'lib/weather-sage/census/match.rb', line 5 def data @data end |
#point ⇒ Object (readonly)
Returns the value of attribute point.
5 6 7 |
# File 'lib/weather-sage/census/match.rb', line 5 def point @point end |