Class: Bnb::All

Inherits:
Object
  • Object
show all
Defined in:
lib/bnb/resources/all.rb

Constant Summary collapse

ALL_LIMIT =
7

Instance Method Summary collapse

Constructor Details

#initialize(params = {}) ⇒ All

Returns a new instance of All.



7
8
9
10
# File 'lib/bnb/resources/all.rb', line 7

def initialize(params = {})
  @start = params.fetch(:start, 1)
  @limit = params.fetch(:limit, ALL_LIMIT)
end

Instance Method Details

#listObject



12
13
14
15
# File 'lib/bnb/resources/all.rb', line 12

def list
  url = Bnb::Base.send(:build_url, '/listings/latest', limit: @limit, start: @start)
  Bnb::Base.request.get(url, headers: Bnb::Base.headers)
end