Class: SenseiApi::StatisticsBase

Inherits:
Object
  • Object
show all
Defined in:
lib/sensei_api/statistics_base.rb

Direct Known Subclasses

EtfStatistics, OptionStatistics, StockStatistics

Class Method Summary collapse

Class Method Details

.base_urlObject



15
16
17
# File 'lib/sensei_api/statistics_base.rb', line 15

def base_url
  @base_url ||= ENV['SENSEI_STATISTICS_API']
end

.statistics(params) ⇒ Object



6
7
8
9
# File 'lib/sensei_api/statistics_base.rb', line 6

def statistics(params)
  response = HTTParty.get(url, query: params.compact, format: :json)
  JSON.parse(response.body, object_class: OpenStruct)
end

.urlObject

Raises:

  • (NotImplementedError)


11
12
13
# File 'lib/sensei_api/statistics_base.rb', line 11

def url
  raise NotImplementedError
end