Class: AddressGeocoder::Parser Abstract
- Inherits:
-
Object
- Object
- AddressGeocoder::Parser
- Defined in:
- lib/address_geocoder/parser.rb
Overview
This class is abstract.
Abstract base class for parsing maps API responses
Direct Known Subclasses
Instance Attribute Summary collapse
-
#address ⇒ Hash
writeonly
An address object.
-
#fields ⇒ Hash
writeonly
A maps API response.
Instance Method Summary collapse
-
#initialize(args = {}) ⇒ Parser
constructor
A new instance of Parser.
-
#parse_response ⇒ Array<Hash>
abstract
A list of matching addresses.
Constructor Details
#initialize(args = {}) ⇒ Parser
Returns a new instance of Parser.
13 14 15 16 |
# File 'lib/address_geocoder/parser.rb', line 13 def initialize(args = {}) @address = args[:address] @fields = args[:fields] end |
Instance Attribute Details
#address=(value) ⇒ Hash (writeonly)
Returns an address object.
8 9 10 |
# File 'lib/address_geocoder/parser.rb', line 8 def address=(value) @address = value end |
#fields=(value) ⇒ Hash (writeonly)
Returns a maps API response.
11 12 13 |
# File 'lib/address_geocoder/parser.rb', line 11 def fields=(value) @fields = value end |
Instance Method Details
#parse_response ⇒ Array<Hash>
This method is abstract.
Abstract base method for parsing maps API responses
Returns a list of matching addresses.
20 21 22 |
# File 'lib/address_geocoder/parser.rb', line 20 def parse_response raise NeedToOveride, 'parse_response' end |