Class: Fountain::Applicant

Inherits:
Object
  • Object
show all
Defined in:
lib/fountain/applicant.rb

Overview

Fountain Applicant

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ Applicant

Returns a new instance of Applicant.

Parameters:

  • data (Hash)

    Raw applicant data



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_dataObject (readonly)

Raw applicant data



9
10
11
# File 'lib/fountain/applicant.rb', line 9

def raw_data
  @raw_data
end

Instance Method Details

#addressesObject

Addresses



104
105
106
# File 'lib/fountain/applicant.rb', line 104

def addresses
  raw_data['addresses']
end

#background_checksObject

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

Returns:

  • (Boolean)


79
80
81
# File 'lib/fountain/applicant.rb', line 79

def can_receive_sms?
  raw_data['can_receive_sms']
end

#created_atObject

Created at



24
25
26
# File 'lib/fountain/applicant.rb', line 24

def created_at
  Time.parse raw_data['created_at']
end

#dataObject

data



99
100
101
# File 'lib/fountain/applicant.rb', line 99

def data
  raw_data['data']
end

#document_signaturesObject

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

Returns:

  • (Boolean)


69
70
71
# File 'lib/fountain/applicant.rb', line 69

def duplicate?
  raw_data['is_duplicate']
end

#emailObject

Email



39
40
41
# File 'lib/fountain/applicant.rb', line 39

def email
  raw_data['email']
end

#first_nameObject

First name



49
50
51
# File 'lib/fountain/applicant.rb', line 49

def first_name
  raw_data['first_name']
end

#funnelObject

Funnel



109
110
111
# File 'lib/fountain/applicant.rb', line 109

def funnel
  Funnel.new raw_data['funnel']
end

#idObject

Applicant ID



19
20
21
# File 'lib/fountain/applicant.rb', line 19

def id
  raw_data['id']
end

#inspectObject



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_nameObject

Last name



54
55
56
# File 'lib/fountain/applicant.rb', line 54

def last_name
  raw_data['last_name']
end

#last_transitioned_atObject

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

#nameObject

Name



44
45
46
# File 'lib/fountain/applicant.rb', line 44

def name
  raw_data['name']
end

#normalized_phone_numberObject

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_reasonObject

On hold reason



94
95
96
# File 'lib/fountain/applicant.rb', line 94

def on_hold_reason
  raw_data['on_hold_reason']
end

#phone_numberObject

Phone number



59
60
61
# File 'lib/fountain/applicant.rb', line 59

def phone_number
  raw_data['phone_number']
end

#phone_platformObject

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

Returns:

  • (Boolean)


74
75
76
# File 'lib/fountain/applicant.rb', line 74

def receive_automated_emails?
  raw_data['receive_automated_emails']
end

#rejection_reasonObject

Rejection reason



89
90
91
# File 'lib/fountain/applicant.rb', line 89

def rejection_reason
  raw_data['rejection_reason']
end

#stageObject

Stage



114
115
116
# File 'lib/fountain/applicant.rb', line 114

def stage
  Stage.new raw_data['stage']
end

#updated_atObject

Updated at



29
30
31
# File 'lib/fountain/applicant.rb', line 29

def updated_at
  Time.parse raw_data['updated_at']
end