Class: TeneoClient::Survey

Inherits:
Object
  • Object
show all
Includes:
HTTParty
Defined in:
lib/teneo_client/survey.rb

Class Method Summary collapse

Class Method Details

.create(survey) ⇒ Object



20
21
22
23
# File 'lib/teneo_client/survey.rb', line 20

def create(survey)
  init
  post("/surveys.xml", payload(survey))
end

.find(id) ⇒ Object



9
10
11
12
13
# File 'lib/teneo_client/survey.rb', line 9

def find(id)
  init
  q = get("/surveys/#{id}.xml")["survey_engine_survey"]
  HashWithIndifferentAccess.new(q)
end

.update(id, survey) ⇒ Object



15
16
17
18
# File 'lib/teneo_client/survey.rb', line 15

def update(id, survey)
  init
  put("/surveys/#{id}.xml", payload(survey))
end