Class: ViralLoops::Resources::Participants

Inherits:
Client
  • Object
show all
Defined in:
lib/viral_loops/resources/participants.rb

Constant Summary collapse

BASE_PATH =
'campaign/participant'

Constants inherited from Client

Client::API_VERSION

Instance Method Summary collapse

Methods inherited from Client

#get, #initialize, #post

Constructor Details

This class inherits a constructor from ViralLoops::Client

Instance Method Details

#convert(params) ⇒ Object



14
15
16
17
18
# File 'lib/viral_loops/resources/participants.rb', line 14

def convert(params)
  response = post("#{BASE_PATH}/convert", params)

  Models::Participant::Convert.new(processing: response['status'])
end

#create(params) ⇒ Object



8
9
10
11
12
# File 'lib/viral_loops/resources/participants.rb', line 8

def create(params)
  response = post(BASE_PATH, params)

  Models::Participant.new(referral_code: response['referralCode'], new: response['isNew'])
end