class PatientZero::Profile
Constants
- CATEGORIES
Attributes
category[RW]
expression[RW]
id[RW]
name[RW]
Public Class Methods
all()
click to toggle source
# File lib/patient_zero/profile.rb, line 16 def self.all response = get '/social/api/v2/monitoring/profiles', api_key: PatientZero.api_key response['profiles'].map do |profile_attributes| new profile_attributes end end
create(params={})
click to toggle source
# File lib/patient_zero/profile.rb, line 28 def self.create params={} response = post '/social/api/v2/monitoring/profiles', api_key: PatientZero.api_key, profile: params new response['profile'] end
find(id)
click to toggle source
# File lib/patient_zero/profile.rb, line 23 def self.find id response = get "/social/api/v2/monitoring/profiles/#{id}", api_key: PatientZero.api_key new response['profile'] end
new(attributes)
click to toggle source
# File lib/patient_zero/profile.rb, line 9 def initialize attributes @id = attributes.fetch 'id' @expression = attributes.fetch 'expression' @name = attributes.fetch 'name' @category = attributes.fetch 'category' end
update(params={})
click to toggle source
# File lib/patient_zero/profile.rb, line 33 def self.update params={} response = put "/social/api/v2/monitoring/profiles/#{params[:id]}", api_key: PatientZero.api_key, profile: params new response['profile'] end