Class: Pipekit::PersonField

Inherits:
Object
  • Object
show all
Includes:
Repository
Defined in:
lib/pipekit/person_field.rb

Instance Method Summary collapse

Methods included from Repository

#all, #create, #find_by, included, #initialize, #update, #where

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Pipekit::Repository

Instance Method Details

#get_by_id(id) ⇒ Object



5
6
7
# File 'lib/pipekit/person_field.rb', line 5

def get_by_id(id)
  request.get("/#{uri}").select { |element| element["id"] == id }
end

#get_by_key(key) ⇒ Object



9
10
11
12
13
# File 'lib/pipekit/person_field.rb', line 9

def get_by_key(key)
  custom_field_key = request.config["people_fields"][key] rescue nil
  key = custom_field_key || key
  request.get("/#{uri}").select { |element| element["key"] == key }
end