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.
158 159 160 |
# File 'lib/jsb.rb', line 158 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.
169 170 171 172 173 |
# File 'lib/jsb.rb', line 169 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.
182 183 184 185 186 |
# File 'lib/jsb.rb', line 182 def view(params = {}) url_params = params_to_url(params) @parent.parse(@parent.api["/statistics/view?#{url_params}"].get(:accept => :json)) end |