Class: Scrapio::Resources::Autotrader
- Inherits:
-
Object
- Object
- Scrapio::Resources::Autotrader
- Defined in:
- lib/scrapio/resources/autotrader.rb
Instance Method Summary collapse
- #get_listing(listing_id, geo: nil) ⇒ Object
-
#initialize(http) ⇒ Autotrader
constructor
A new instance of Autotrader.
- #search(postcode:, radius: nil, make: nil, model: nil, year_from: nil, year_to: nil, exclude_writeoffs: nil, page: nil, geo: nil) ⇒ Object
Constructor Details
#initialize(http) ⇒ Autotrader
Returns a new instance of Autotrader.
4 |
# File 'lib/scrapio/resources/autotrader.rb', line 4 def initialize(http) = @http = http |
Instance Method Details
#get_listing(listing_id, geo: nil) ⇒ Object
14 15 16 17 18 |
# File 'lib/scrapio/resources/autotrader.rb', line 14 def get_listing(listing_id, geo: nil) @http.get("/v1/autotrader/listing", { listing_id: listing_id, geo: geo, }) end |
#search(postcode:, radius: nil, make: nil, model: nil, year_from: nil, year_to: nil, exclude_writeoffs: nil, page: nil, geo: nil) ⇒ Object
6 7 8 9 10 11 12 |
# File 'lib/scrapio/resources/autotrader.rb', line 6 def search(postcode:, radius: nil, make: nil, model: nil, year_from: nil, year_to: nil, exclude_writeoffs: nil, page: nil, geo: nil) @http.get("/v1/autotrader/search", { postcode: postcode, radius: radius, make: make, model: model, year_from: year_from, year_to: year_to, exclude_writeoffs: exclude_writeoffs, page: page, geo: geo, }) end |