class ElectricProfile::RespondentProfiler

Attributes

profiler[RW]
questions[RW]

Public Class Methods

find(profiler_id, user_id, locale) click to toggle source
# File lib/electric_profile_ruby/respondent_profiler.rb, line 20
def self.find(profiler_id, user_id, locale)
  client = Client.new
  if client.fetch_respondent_profiler(profiler_id, user_id, locale)
    new client.data
  else
    raise StandardError, client.error
  end
end
new(atts) click to toggle source
# File lib/electric_profile_ruby/respondent_profiler.rb, line 6
def initialize(atts)
  atts = atts.inject({}){ |memo, (k, v) | memo[k.to_sym] = v; memo }
  @questions = atts[:questions]
  @profiler = atts[:profiler]
end

Public Instance Methods

save() click to toggle source
# File lib/electric_profile_ruby/respondent_profiler.rb, line 12
def save
  if @id
    save_existing
  else
    save_new
  end
end