Class: HasOffers::Advertiser

Inherits:
Base
  • Object
show all
Defined in:
lib/hasoffers/advertiser.rb

Constant Summary collapse

Target =
'Advertiser'

Class Method Summary collapse

Methods inherited from Base

api_mode, api_mode=, base_uri, base_uri=, get_request, initialize_credentials, live?, post_request, requires!, test?

Class Method Details

.create(data, return_object = false) ⇒ Object


13
14
15
16
17
# File 'lib/hasoffers/advertiser.rb', line 13

def create(data, return_object = false)
  requires!(data, %w[company address1 city country zipcode phone])
  params = build_data(data, return_object)
  post_request(Target, 'create', params)
end

.find_all(params = {}) ⇒ Object


9
10
11
# File 'lib/hasoffers/advertiser.rb', line 9

def find_all(params = {})
  post_request(Target, 'findAll', params)
end

.update(id, data, return_object = false) ⇒ Object


19
20
21
22
23
# File 'lib/hasoffers/advertiser.rb', line 19

def update(id, data, return_object = false)
  params = build_data(data, return_object)
  params['id'] = id
  post_request(Target, 'update', params)
end