Class: DfpApi::Api
- Inherits:
-
AdsCommon::Api
- Object
- AdsCommon::Api
- DfpApi::Api
- Defined in:
- lib/dfp_api.rb
Overview
Wrapper class that serves as the main point of access for all the API usage.
Holds all the services, as well as login credentials.
Instance Attribute Summary collapse
-
#utils_reporter ⇒ Object
readonly
Returns the value of attribute utils_reporter.
Instance Method Summary collapse
-
#api_config ⇒ Object
Getter for the API service configurations.
-
#date(*args) ⇒ Object
Returns an instance of DfpDate.
-
#datetime(*args) ⇒ Object
Returns an instance of DfpDateTime.
-
#initialize(provided_config = nil) ⇒ Api
constructor
Constructor for API.
- #new_report_statement_builder(&block) ⇒ Object
-
#new_statement_builder(&block) ⇒ Object
Returns an instance of StatementBuilder object.
-
#now(*args) ⇒ Object
Returns an instance of DfpDateTime representing the current time.
-
#today(*args) ⇒ Object
Returns an instance of DfpDate representing the current day.
-
#utc(*args) ⇒ Object
Returns an instance of DfpDateTime in the UTC timezone.
Constructor Details
#initialize(provided_config = nil) ⇒ Api
Constructor for API.
41 42 43 44 45 |
# File 'lib/dfp_api.rb', line 41 def initialize(provided_config = nil) super(provided_config) @credential_handler = DfpApi::CredentialHandler.new(@config) @utils_reporter = DfpApi::UtilsReporter.new(@credential_handler) end |
Instance Attribute Details
#utils_reporter ⇒ Object (readonly)
Returns the value of attribute utils_reporter.
38 39 40 |
# File 'lib/dfp_api.rb', line 38 def utils_reporter @utils_reporter end |
Instance Method Details
#api_config ⇒ Object
Getter for the API service configurations.
48 49 50 |
# File 'lib/dfp_api.rb', line 48 def api_config DfpApi::ApiConfig end |
#date(*args) ⇒ Object
Returns an instance of DfpDate.
67 68 69 |
# File 'lib/dfp_api.rb', line 67 def date(*args) return DfpApi::DfpDate.new(self, *args) end |
#datetime(*args) ⇒ Object
Returns an instance of DfpDateTime.
77 78 79 |
# File 'lib/dfp_api.rb', line 77 def datetime(*args) return DfpApi::DfpDateTime.new(self, *args) end |
#new_report_statement_builder(&block) ⇒ Object
57 58 59 60 61 62 63 64 |
# File 'lib/dfp_api.rb', line 57 def new_report_statement_builder(&block) statement = DfpApi::StatementBuilder.new(self) do |sb| sb.limit = nil sb.offset = nil end statement.configure(&block) return statement end |
#new_statement_builder(&block) ⇒ Object
Returns an instance of StatementBuilder object.
53 54 55 |
# File 'lib/dfp_api.rb', line 53 def new_statement_builder(&block) return DfpApi::StatementBuilder.new(self, &block) end |
#now(*args) ⇒ Object
Returns an instance of DfpDateTime representing the current time.
82 83 84 |
# File 'lib/dfp_api.rb', line 82 def now(*args) return DfpApi::DfpDateTime.now(self, *args) end |
#today(*args) ⇒ Object
Returns an instance of DfpDate representing the current day.
72 73 74 |
# File 'lib/dfp_api.rb', line 72 def today(*args) return DfpApi::DfpDate.today(self, *args) end |
#utc(*args) ⇒ Object
Returns an instance of DfpDateTime in the UTC timezone.
87 88 89 |
# File 'lib/dfp_api.rb', line 87 def utc(*args) return DfpApi::DfpDateTime.utc(self, *args) end |