Class: SgPostcode::Google
- Inherits:
-
Object
- Object
- SgPostcode::Google
- Defined in:
- lib/sg_postcode/services/google.rb
Constant Summary collapse
- REQUEST_SERVICE_URL =
Request URL
'https://maps.googleapis.com/maps/api/geocode/json'
Instance Method Summary collapse
-
#initialize(postcode) ⇒ Google
constructor
A new instance of Google.
-
#request ⇒ Object
Send Request with the postcode included as a params.
Constructor Details
#initialize(postcode) ⇒ Google
Returns a new instance of Google.
8 9 10 |
# File 'lib/sg_postcode/services/google.rb', line 8 def initialize(postcode) @postcode = postcode end |
Instance Method Details
#request ⇒ Object
Send Request with the postcode included as a params
18 19 20 |
# File 'lib/sg_postcode/services/google.rb', line 18 def request RestClient.get REQUEST_SERVICE_URL, { params: { address: @postcode } } end |