Class: IdealPostcodes::PlacesResource

Inherits:
Resource
  • Object
show all
Defined in:
lib/ideal_postcodes/resources/places.rb

Instance Attribute Summary

Attributes inherited from Resource

#client

Instance Method Summary collapse

Methods inherited from Resource

#initialize

Constructor Details

This class inherits a constructor from IdealPostcodes::Resource

Instance Method Details

#find(**params) ⇒ Object



4
5
6
7
# File 'lib/ideal_postcodes/resources/places.rb', line 4

def find(**params)
  response = get_request("places", params: params)
  Collection.from_response(response, type: Place)
end

#resolve(place:) ⇒ Object



9
10
11
12
# File 'lib/ideal_postcodes/resources/places.rb', line 9

def resolve(place:)
  response = get_request("places/#{place}")
  Place.new(response.body["result"])
end