Class: Naver::Searchad::Api::Stat::Service
- Inherits:
-
Core::BaseService
- Object
- Core::BaseService
- Naver::Searchad::Api::Stat::Service
- Defined in:
- lib/naver/searchad/api/stat/service.rb
Instance Attribute Summary
Attributes inherited from Core::BaseService
#base_path, #client_options, #request_options, #url
Instance Method Summary collapse
- #get_stat_by_id(id, fields, time_range, options: {}, &block) ⇒ Object
- #get_stat_by_ids(ids, fields, time_range, options: {}, &block) ⇒ Object
-
#initialize ⇒ Service
constructor
A new instance of Service.
Methods inherited from Core::BaseService
#authorization, #authorization=, #client
Methods included from Core::Logging
Constructor Details
#initialize ⇒ Service
Returns a new instance of Service.
9 10 11 |
# File 'lib/naver/searchad/api/stat/service.rb', line 9 def initialize super('https://api.naver.com/', '') end |
Instance Method Details
#get_stat_by_id(id, fields, time_range, options: {}, &block) ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/naver/searchad/api/stat/service.rb', line 13 def get_stat_by_id(id, fields, time_range, options: {}, &block) command = make_command(:get, 'stats', ) command.query['id'] = id command.query['fields'] = fields.to_json command.query['timeRange'] = time_range.to_json command.query['datePreset'] = [:date_preset] if [:date_preset] command.query['timeIncrement'] = [:time_increment] if [:time_increment] command.query['breakdown'] = [:breakdown] if [:breakdown] execute_command(command, &block) end |
#get_stat_by_ids(ids, fields, time_range, options: {}, &block) ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/naver/searchad/api/stat/service.rb', line 25 def get_stat_by_ids(ids, fields, time_range, options: {}, &block) command = make_command(:get, 'stats', ) command.query['ids'] = ids command.query['fields'] = fields.to_json command.query['timeRange'] = time_range.to_json command.query['datePreset'] = [:date_preset] if [:date_preset] command.query['timeIncrement'] = [:time_increment] if [:time_increment] command.query['breakdown'] = [:breakdown] if [:breakdown] execute_command(command, &block) end |