class Five9::Profile

Attributes

attributes[R]

Public Class Methods

all() click to toggle source
# File lib/five9/user_resources/profile.rb, line 25
def self.all
  ProfileManagement.get_user_profiles.map do |profile_info|
    self.new(profile_info)
  end
end
create!(args) click to toggle source
# File lib/five9/user_resources/profile.rb, line 17
def self.create!(args)
  self.new(ProfileManagement.create_user_profile(args))
end
find(profile_name) click to toggle source
# File lib/five9/user_resources/profile.rb, line 21
def self.find(profile_name)
  self.new(matching_profile(all, profile_name))
end
new(args) click to toggle source
# File lib/five9/user_resources/profile.rb, line 4
def initialize(args)
  @attributes = AccessibleHash.new(args)
end

Private Class Methods

matching_profile(all_profiles, profile_name) click to toggle source
# File lib/five9/user_resources/profile.rb, line 32
def self.matching_profile(all_profiles, profile_name)
  matching_profile = all_profiles.select do |profile|
    profile[:name] == profile_name
  end
  raise "No matching profiles were found!" if matching_profile.first.nil?
  matching_profile.first
end

Public Instance Methods

method_missing(method_name, *args) click to toggle source
# File lib/five9/user_resources/profile.rb, line 13
def method_missing(method_name, *args)
  @attributes.send(method_name, *args)
end
save() click to toggle source
# File lib/five9/user_resources/profile.rb, line 8
def save
  ProfileManagement.modify_user_profile(self.to_h)
end
Also aliased as: update!
update!()
Alias for: save