Class: Fountain::Applicant
- Inherits:
-
Object
- Object
- Fountain::Applicant
- Defined in:
- lib/fountain/applicant.rb
Overview
Fountain Applicant
Instance Attribute Summary collapse
-
#raw_data ⇒ Object
readonly
Raw applicant data.
Instance Method Summary collapse
-
#addresses ⇒ Object
Addresses.
-
#background_checks ⇒ Object
Background checks.
-
#can_receive_sms? ⇒ Boolean
Can receive sms.
-
#created_at ⇒ Object
Created at.
-
#data ⇒ Object
data.
-
#document_signatures ⇒ Object
Document signatures.
-
#duplicate? ⇒ Boolean
Is duplicate.
-
#email ⇒ Object
Email.
-
#first_name ⇒ Object
First name.
-
#funnel ⇒ Object
Funnel.
-
#id ⇒ Object
Applicant ID.
-
#initialize(data) ⇒ Applicant
constructor
A new instance of Applicant.
- #inspect ⇒ Object
-
#last_name ⇒ Object
Last name.
-
#last_transitioned_at ⇒ Object
Last transitioned at.
-
#name ⇒ Object
Name.
-
#normalized_phone_number ⇒ Object
Normalized phone number.
-
#on_hold_reason ⇒ Object
On hold reason.
-
#phone_number ⇒ Object
Phone number.
-
#phone_platform ⇒ Object
Phone platform.
-
#receive_automated_emails? ⇒ Boolean
Receive automated emails.
-
#rejection_reason ⇒ Object
Rejection reason.
-
#stage ⇒ Object
Stage.
-
#updated_at ⇒ Object
Updated at.
Constructor Details
#initialize(data) ⇒ Applicant
Returns a new instance of Applicant.
14 15 16 |
# File 'lib/fountain/applicant.rb', line 14 def initialize(data) @raw_data = Util.stringify_hash_keys data end |
Instance Attribute Details
#raw_data ⇒ Object (readonly)
Raw applicant data
9 10 11 |
# File 'lib/fountain/applicant.rb', line 9 def raw_data @raw_data end |
Instance Method Details
#addresses ⇒ Object
Addresses
104 105 106 |
# File 'lib/fountain/applicant.rb', line 104 def addresses raw_data['addresses'] end |
#background_checks ⇒ Object
Background checks
119 120 121 122 123 |
# File 'lib/fountain/applicant.rb', line 119 def background_checks return [] unless raw_data['background_checks'].is_a? Array raw_data['background_checks'].map { |check| BackgroundCheck.new check } end |
#can_receive_sms? ⇒ Boolean
Can receive sms
79 80 81 |
# File 'lib/fountain/applicant.rb', line 79 def can_receive_sms? raw_data['can_receive_sms'] end |
#created_at ⇒ Object
Created at
24 25 26 |
# File 'lib/fountain/applicant.rb', line 24 def created_at Time.parse raw_data['created_at'] end |
#data ⇒ Object
data
99 100 101 |
# File 'lib/fountain/applicant.rb', line 99 def data raw_data['data'] end |
#document_signatures ⇒ Object
Document signatures
126 127 128 129 130 |
# File 'lib/fountain/applicant.rb', line 126 def document_signatures return [] unless raw_data['document_signatures'].is_a? Array raw_data['document_signatures'].map { |signature| DocumentSignature.new signature } end |
#duplicate? ⇒ Boolean
Is duplicate
69 70 71 |
# File 'lib/fountain/applicant.rb', line 69 def duplicate? raw_data['is_duplicate'] end |
#email ⇒ Object
39 40 41 |
# File 'lib/fountain/applicant.rb', line 39 def email raw_data['email'] end |
#first_name ⇒ Object
First name
49 50 51 |
# File 'lib/fountain/applicant.rb', line 49 def first_name raw_data['first_name'] end |
#funnel ⇒ Object
Funnel
109 110 111 |
# File 'lib/fountain/applicant.rb', line 109 def funnel Funnel.new raw_data['funnel'] end |
#id ⇒ Object
Applicant ID
19 20 21 |
# File 'lib/fountain/applicant.rb', line 19 def id raw_data['id'] end |
#inspect ⇒ Object
132 133 134 135 136 137 138 139 140 141 |
# File 'lib/fountain/applicant.rb', line 132 def inspect format( '#<%<class_name>s:0x%<object_id>p @id="%<id>s" @name="%<name>s" @email="%<email>s">', class_name: self.class.name, object_id: object_id, id: id, name: name, email: email ) end |
#last_name ⇒ Object
Last name
54 55 56 |
# File 'lib/fountain/applicant.rb', line 54 def last_name raw_data['last_name'] end |
#last_transitioned_at ⇒ Object
Last transitioned at
34 35 36 |
# File 'lib/fountain/applicant.rb', line 34 def last_transitioned_at Time.parse raw_data['last_transitioned_at'] end |
#name ⇒ Object
Name
44 45 46 |
# File 'lib/fountain/applicant.rb', line 44 def name raw_data['name'] end |
#normalized_phone_number ⇒ Object
Normalized phone number
64 65 66 |
# File 'lib/fountain/applicant.rb', line 64 def normalized_phone_number raw_data['normalized_phone_number'] end |
#on_hold_reason ⇒ Object
On hold reason
94 95 96 |
# File 'lib/fountain/applicant.rb', line 94 def on_hold_reason raw_data['on_hold_reason'] end |
#phone_number ⇒ Object
Phone number
59 60 61 |
# File 'lib/fountain/applicant.rb', line 59 def phone_number raw_data['phone_number'] end |
#phone_platform ⇒ Object
Phone platform
84 85 86 |
# File 'lib/fountain/applicant.rb', line 84 def phone_platform raw_data['phone_platform'] end |
#receive_automated_emails? ⇒ Boolean
Receive automated emails
74 75 76 |
# File 'lib/fountain/applicant.rb', line 74 def receive_automated_emails? raw_data['receive_automated_emails'] end |
#rejection_reason ⇒ Object
Rejection reason
89 90 91 |
# File 'lib/fountain/applicant.rb', line 89 def rejection_reason raw_data['rejection_reason'] end |
#stage ⇒ Object
Stage
114 115 116 |
# File 'lib/fountain/applicant.rb', line 114 def stage Stage.new raw_data['stage'] end |
#updated_at ⇒ Object
Updated at
29 30 31 |
# File 'lib/fountain/applicant.rb', line 29 def updated_at Time.parse raw_data['updated_at'] end |