Class: JSB::Statistics
- Inherits:
-
Object
- Object
- JSB::Statistics
- Defined in:
- lib/jsb.rb
Overview
Group of statistics methods.
Instance Method Summary collapse
-
#initialize(parent) ⇒ Statistics
constructor
A new instance of Statistics.
-
#register(params = {}) ⇒ Object
Register statistics for specific resource.
-
#view(params = {}) ⇒ Object
View statistics for specifc resource.
Constructor Details
#initialize(parent) ⇒ Statistics
Returns a new instance of Statistics.
139 140 141 |
# File 'lib/jsb.rb', line 139 def initialize(parent) @parent = parent end |
Instance Method Details
#register(params = {}) ⇒ Object
Register statistics for specific resource.
Arguments:
params: (Hash)
journal_id: (Integer) id of journal.
issue_id: (Integer) id of issue.
article_id: (Integer) id of article.
150 151 152 153 154 |
# File 'lib/jsb.rb', line 150 def register(params = {}) url_params = params_to_url(params) @parent.api["/statistics/register?#{url_params}"].put :accept => :json end |
#view(params = {}) ⇒ Object
View statistics for specifc resource.
Arguments:
params: (Hash)
journal_id: (Integer) id of journal.
issue_id: (Integer) id of issue.
article_id: (Integer) id of article.
163 164 165 166 167 |
# File 'lib/jsb.rb', line 163 def view(params = {}) url_params = params_to_url(params) @parent.parse(@parent.api["/statistics/view?#{url_params}"].get(:accept => :json)) end |