Class: Ryext::Account
- Inherits:
-
Object
- Object
- Ryext::Account
- Defined in:
- lib/ryext/account.rb
Overview
GOOGLEPLACES # Google Reviews cannot be scanned LOCALCOM # Local.com cannot be scanned SOLEO # Soleo cannot be scanned
Instance Attribute Summary collapse
-
#api_key ⇒ Object
Returns the value of attribute api_key.
Instance Method Summary collapse
- #api_client ⇒ Object
- #categories ⇒ Object
- #customer(customer_id) ⇒ Object
- #customers ⇒ Object
-
#initialize(api_key) ⇒ Account
constructor
A new instance of Account.
- #offer(id) ⇒ Object
- #offers ⇒ Object
- #optimization_tasks ⇒ Object
- #order(id) ⇒ Object
- #orders ⇒ Object
- #post_request(query) ⇒ Object
- #publisher_suggestions ⇒ Object
- #request(query) ⇒ Object
- #scan(params) ⇒ Object
- #status(params) ⇒ Object
Constructor Details
#initialize(api_key) ⇒ Account
Returns a new instance of Account.
66 67 68 |
# File 'lib/ryext/account.rb', line 66 def initialize(api_key) @api_key = api_key end |
Instance Attribute Details
#api_key ⇒ Object
Returns the value of attribute api_key.
64 65 66 |
# File 'lib/ryext/account.rb', line 64 def api_key @api_key end |
Instance Method Details
#api_client ⇒ Object
70 71 72 |
# File 'lib/ryext/account.rb', line 70 def api_client @api_client ||= Client.new(self) end |
#categories ⇒ Object
108 109 110 |
# File 'lib/ryext/account.rb', line 108 def categories Models::Category.all(self) end |
#customer(customer_id) ⇒ Object
88 89 90 |
# File 'lib/ryext/account.rb', line 88 def customer(customer_id) Models::Customer.get(self, 'id' => customer_id) unless customer_id.nil? end |
#customers ⇒ Object
84 85 86 |
# File 'lib/ryext/account.rb', line 84 def customers Models::Customer.all(self) end |
#offer(id) ⇒ Object
96 97 98 |
# File 'lib/ryext/account.rb', line 96 def offer(id) Models::Offer.get(self, 'id' => id) end |
#offers ⇒ Object
92 93 94 |
# File 'lib/ryext/account.rb', line 92 def offers Models::Offer.all(self) end |
#optimization_tasks ⇒ Object
112 113 114 |
# File 'lib/ryext/account.rb', line 112 def optimization_tasks Models::OptimizationTask.all(self) end |
#order(id) ⇒ Object
104 105 106 |
# File 'lib/ryext/account.rb', line 104 def order(id) Models::Order.get(self, id: id) end |
#orders ⇒ Object
100 101 102 |
# File 'lib/ryext/account.rb', line 100 def orders Models::Order.all(self) end |
#post_request(query) ⇒ Object
124 125 126 |
# File 'lib/ryext/account.rb', line 124 def post_request(query) Request.new(self, query, 'POST').response end |
#publisher_suggestions ⇒ Object
116 117 118 |
# File 'lib/ryext/account.rb', line 116 def publisher_suggestions Models::PublisherSuggestion.all(self) end |
#request(query) ⇒ Object
120 121 122 |
# File 'lib/ryext/account.rb', line 120 def request(query) Request.new(self, query).response end |