Class: SenseiApi::StatisticsBase
- Inherits:
-
Object
- Object
- SenseiApi::StatisticsBase
show all
- Defined in:
- lib/sensei_api/statistics_base.rb
Class Method Summary
collapse
Class Method Details
.base_url ⇒ Object
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
|
.url ⇒ Object
11
12
13
|
# File 'lib/sensei_api/statistics_base.rb', line 11
def url
raise NotImplementedError
end
|