Class: HasOffers::Conversion

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

Constant Summary collapse

Target =
'Conversion'

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, number = nil) ⇒ Object

number is number of conversions to create. Defaults to 1 on has offers side


10
11
12
13
14
15
# File 'lib/hasoffers/conversion.rb', line 10

def create(data, number = nil)
  requires!(data, %w[affiliate_id offer_id payout revenue])
  params = build_data data
  params['number'] = number if number
  post_request(Target, 'create', params)
end

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


17
18
19
20
21
# File 'lib/hasoffers/conversion.rb', line 17

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