Class: Ryext::Account

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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_keyObject

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_clientObject



70
71
72
# File 'lib/ryext/account.rb', line 70

def api_client
  @api_client ||= Client.new(self)
end

#categoriesObject



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

#customersObject



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

#offersObject



92
93
94
# File 'lib/ryext/account.rb', line 92

def offers
  Models::Offer.all(self)
end

#optimization_tasksObject



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

#ordersObject



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_suggestionsObject



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

#scan(params) ⇒ Object



74
75
76
77
78
# File 'lib/ryext/account.rb', line 74

def scan(params)
  Models::Scan.get(self, params)
rescue
  nil
end

#status(params) ⇒ Object



80
81
82
# File 'lib/ryext/account.rb', line 80

def status(params)
  Models::Status.all(self, params)
end