Class: Bnb::Gainer

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

Constant Summary collapse

GAIN_LIMIT =
100

Instance Method Summary collapse

Constructor Details

#initialize(params = {}) ⇒ Gainer

Returns a new instance of Gainer.



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

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

Instance Method Details

#listObject



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

def list
  url = Bnb::Base.send(:build_url, '/trending/gainers-losers', sort_dir: 'desc', limit: @limit, start: @start)
  Bnb::Base.request.get(url, headers: Bnb::Base.headers)
end