Class: Blackbaud::Person
- Inherits:
-
BlackbaudObject
- Object
- BlackbaudObject
- Blackbaud::Person
- Defined in:
- lib/blackbaud-client/api/person.rb
Constant Summary collapse
- USER_TYPE =
{ :faculty => 1, :student => 2, :undefined => nil, }
Instance Attribute Summary collapse
-
#birth_date ⇒ Object
Returns the value of attribute birth_date.
-
#class_of ⇒ Object
Returns the value of attribute class_of.
-
#contacts ⇒ Object
Returns the value of attribute contacts.
-
#deceased ⇒ Object
Returns the value of attribute deceased.
-
#ea7_record_id ⇒ Object
Returns the value of attribute ea7_record_id.
-
#first_name ⇒ Object
Returns the value of attribute first_name.
-
#grade_level ⇒ Object
Returns the value of attribute grade_level.
-
#import_id ⇒ Object
Returns the value of attribute import_id.
-
#last_name ⇒ Object
Returns the value of attribute last_name.
-
#middle_name ⇒ Object
Returns the value of attribute middle_name.
-
#name_for_display ⇒ Object
Returns the value of attribute name_for_display.
-
#nickname ⇒ Object
Returns the value of attribute nickname.
-
#online_user_id ⇒ Object
Returns the value of attribute online_user_id.
-
#record_type ⇒ Object
Returns the value of attribute record_type.
-
#relations ⇒ Object
Returns the value of attribute relations.
-
#suffix ⇒ Object
Returns the value of attribute suffix.
-
#title ⇒ Object
Returns the value of attribute title.
-
#type ⇒ Object
Returns the value of attribute type.
-
#user_defined_id ⇒ Object
Returns the value of attribute user_defined_id.
Attributes inherited from BlackbaudObject
Instance Method Summary collapse
- #faculty? ⇒ Boolean
-
#initialize(options) ⇒ Person
constructor
A new instance of Person.
- #student? ⇒ Boolean
- #undefined_type? ⇒ Boolean
Methods inherited from BlackbaudObject
#format_date, #to_hash, #to_json
Constructor Details
#initialize(options) ⇒ Person
Returns a new instance of Person.
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/blackbaud-client/api/person.rb', line 11 def initialize() if .fetch(:values)["bio"] .fetch(:values)["bio"].each {|k, v| .fetch(:values)[k] = v} .fetch(:values).delete("bio") end if .fetch(:values)["contact_info"] .fetch(:values)["contacts"] = .fetch(:values)["contact_info"].map {|c| Blackbaud::Contact.new({values: c})} .fetch(:values).delete("contact_info") else .fetch(:values)["contacts"] = [] end if .fetch(:values)["relations"] .fetch(:values)["relations"].map! {|r| Blackbaud::Relation.new({values: r})} else .fetch(:values)["relations"] = [] end .fetch(:values)["birth_date"] = format_date(.fetch(:values)["birth_date"]) if .fetch(:values)["birth_date"] super end |
Instance Attribute Details
#birth_date ⇒ Object
Returns the value of attribute birth_date.
3 4 5 |
# File 'lib/blackbaud-client/api/person.rb', line 3 def birth_date @birth_date end |
#class_of ⇒ Object
Returns the value of attribute class_of.
3 4 5 |
# File 'lib/blackbaud-client/api/person.rb', line 3 def class_of @class_of end |
#contacts ⇒ Object
Returns the value of attribute contacts.
3 4 5 |
# File 'lib/blackbaud-client/api/person.rb', line 3 def contacts @contacts end |
#deceased ⇒ Object
Returns the value of attribute deceased.
3 4 5 |
# File 'lib/blackbaud-client/api/person.rb', line 3 def deceased @deceased end |
#ea7_record_id ⇒ Object
Returns the value of attribute ea7_record_id.
3 4 5 |
# File 'lib/blackbaud-client/api/person.rb', line 3 def ea7_record_id @ea7_record_id end |
#first_name ⇒ Object
Returns the value of attribute first_name.
3 4 5 |
# File 'lib/blackbaud-client/api/person.rb', line 3 def first_name @first_name end |
#grade_level ⇒ Object
Returns the value of attribute grade_level.
3 4 5 |
# File 'lib/blackbaud-client/api/person.rb', line 3 def grade_level @grade_level end |
#import_id ⇒ Object
Returns the value of attribute import_id.
3 4 5 |
# File 'lib/blackbaud-client/api/person.rb', line 3 def import_id @import_id end |
#last_name ⇒ Object
Returns the value of attribute last_name.
3 4 5 |
# File 'lib/blackbaud-client/api/person.rb', line 3 def last_name @last_name end |
#middle_name ⇒ Object
Returns the value of attribute middle_name.
3 4 5 |
# File 'lib/blackbaud-client/api/person.rb', line 3 def middle_name @middle_name end |
#name_for_display ⇒ Object
Returns the value of attribute name_for_display.
3 4 5 |
# File 'lib/blackbaud-client/api/person.rb', line 3 def name_for_display @name_for_display end |
#nickname ⇒ Object
Returns the value of attribute nickname.
3 4 5 |
# File 'lib/blackbaud-client/api/person.rb', line 3 def nickname @nickname end |
#online_user_id ⇒ Object
Returns the value of attribute online_user_id.
3 4 5 |
# File 'lib/blackbaud-client/api/person.rb', line 3 def online_user_id @online_user_id end |
#record_type ⇒ Object
Returns the value of attribute record_type.
3 4 5 |
# File 'lib/blackbaud-client/api/person.rb', line 3 def record_type @record_type end |
#relations ⇒ Object
Returns the value of attribute relations.
3 4 5 |
# File 'lib/blackbaud-client/api/person.rb', line 3 def relations @relations end |
#suffix ⇒ Object
Returns the value of attribute suffix.
3 4 5 |
# File 'lib/blackbaud-client/api/person.rb', line 3 def suffix @suffix end |
#title ⇒ Object
Returns the value of attribute title.
3 4 5 |
# File 'lib/blackbaud-client/api/person.rb', line 3 def title @title end |
#type ⇒ Object
Returns the value of attribute type.
3 4 5 |
# File 'lib/blackbaud-client/api/person.rb', line 3 def type @type end |
#user_defined_id ⇒ Object
Returns the value of attribute user_defined_id.
3 4 5 |
# File 'lib/blackbaud-client/api/person.rb', line 3 def user_defined_id @user_defined_id end |
Instance Method Details
#faculty? ⇒ Boolean
35 36 37 |
# File 'lib/blackbaud-client/api/person.rb', line 35 def faculty? type == USER_TYPE[:faculty] end |
#student? ⇒ Boolean
39 40 41 |
# File 'lib/blackbaud-client/api/person.rb', line 39 def student? type == USER_TYPE[:student] end |
#undefined_type? ⇒ Boolean
43 44 45 |
# File 'lib/blackbaud-client/api/person.rb', line 43 def undefined_type? type == USER_TYPE[:undefined] end |