Class: Bnb::New
- Inherits:
-
Object
- Object
- Bnb::New
- Defined in:
- lib/bnb/resources/new.rb
Constant Summary collapse
- NEW_LIMIT =
100
Instance Method Summary collapse
-
#initialize(params = {}) ⇒ New
constructor
A new instance of New.
- #list ⇒ Object
Constructor Details
#initialize(params = {}) ⇒ New
Returns a new instance of New.
7 8 9 10 |
# File 'lib/bnb/resources/new.rb', line 7 def initialize(params = {}) @start = params.fetch(:start, 1) @limit = params.fetch(:limit, NEW_LIMIT) end |
Instance Method Details
#list ⇒ Object
12 13 14 15 |
# File 'lib/bnb/resources/new.rb', line 12 def list url = Bnb::Base.send(:build_url, '/listings/new', limit: @limit, start: @start) Bnb::Base.request.get(url, headers: Bnb::Base.headers) end |