Class: FriendlyScore::User

Inherits:
Object
  • Object
show all
Defined in:
lib/friendly_score/user.rb

Instance Method Summary collapse

Constructor Details

#initialize(attributes) ⇒ User

Returns a new instance of User.



3
4
5
# File 'lib/friendly_score/user.rb', line 3

def initialize attributes
  @attributes = attributes
end

Instance Method Details

#addressString

Address

Returns:

  • (String)

    address



28
29
30
# File 'lib/friendly_score/user.rb', line 28

def address
  @attributes["address"]
end

#ageInteger

Age of the user

Returns:

  • (Integer)

    age of the user



35
36
37
# File 'lib/friendly_score/user.rb', line 35

def age
  @attributes["age"].to_i
end

#attributesObject



7
8
9
# File 'lib/friendly_score/user.rb', line 7

def attributes
  @attributes
end

#city_nameString

City name

Returns:

  • (String)

    city name



42
43
44
# File 'lib/friendly_score/user.rb', line 42

def city_name
  @attributes["city_name"]
end

#city_population_50kString

City population

Returns:

  • (String)

    city population



49
50
51
# File 'lib/friendly_score/user.rb', line 49

def city_population_50k
  @attributes["city_population_50k"]
end

#contact_bank_in_90_daysString

Contact bank in 90 days

Returns:

  • (String)

    contact bank in 90 days



56
57
58
# File 'lib/friendly_score/user.rb', line 56

def contact_bank_in_90_days
  @attributes["contact_bank_in_90_days"]
end

#education_averageString

Education average

Returns:

  • (String)

    education average



70
71
72
# File 'lib/friendly_score/user.rb', line 70

def education_average
  @attributes["education_average"]
end

#education_best_findString

Education best find

Returns:

  • (String)

    education best find



63
64
65
# File 'lib/friendly_score/user.rb', line 63

def education_best_find
  @attributes["education_best_find"]
end

#educationsString

Educations

Returns:

  • (String)

    educations



77
78
79
# File 'lib/friendly_score/user.rb', line 77

def educations
  @attributes["educations"]
end

#emailString

Email

Returns:

  • (String)

    email



84
85
86
# File 'lib/friendly_score/user.rb', line 84

def email
  @attributes["email"]
end

#facebook_idString

Facebook id

Returns:

  • (String)

    facebook id



112
113
114
# File 'lib/friendly_score/user.rb', line 112

def facebook_id
  @attributes["facebook_id"]
end

#familyString

Family

Returns:

  • (String)

    family



91
92
93
# File 'lib/friendly_score/user.rb', line 91

def family
  @attributes["family"]
end

#family_members_in_homeInteger

Number of family members at home

Returns:

  • (Integer)

    number of family members at home



98
99
100
# File 'lib/friendly_score/user.rb', line 98

def family_members_in_home
  @attributes["family_members_in_home"].to_i
end

#friendlyscoreInteger

Friendly score

Returns:

  • (Integer)

    friendly score



105
106
107
# File 'lib/friendly_score/user.rb', line 105

def friendlyscore
  @attributes["friendlyscore"]
end

#genderSymbol

Gender of the user

Returns:

  • (Symbol)

    :male or :female



119
120
121
# File 'lib/friendly_score/user.rb', line 119

def gender
  @attributes["gender"] == "male" ? :male : :female
end

#has_kidsInteger

Number of kids

Returns:

  • (Integer)

    number of kids



126
127
128
# File 'lib/friendly_score/user.rb', line 126

def has_kids
  @attributes["kids"].to_i
end

#idInteger

Id

Returns:

  • (Integer)

    users id



14
15
16
# File 'lib/friendly_score/user.rb', line 14

def id
  @attributes["id"]
end

#in_relationship?Boolean

Relationship

Returns:

  • (Boolean)

    true if user is in relationship, false if not



133
134
135
# File 'lib/friendly_score/user.rb', line 133

def in_relationship?
  @attributes["in_relationship"] == "In a relationship"
end

#lead?Boolean

Is lead

Returns:

  • (Boolean)

    true if is lead, false in other case, nil if not set



140
141
142
143
# File 'lib/friendly_score/user.rb', line 140

def lead?
  return nil unless @attributes["is_lead"]
  @attributes["is_lead"].to_i == 1
end

#loan_amountInteger

Loan amount

Returns:

  • (Integer)

    loan amount



164
165
166
# File 'lib/friendly_score/user.rb', line 164

def loan_amount
  @attributes["loan_amount"]
end

#loan_currencyString

Loan currency

Returns:

  • (String)

    loan currency



171
172
173
# File 'lib/friendly_score/user.rb', line 171

def loan_currency
  @attributes["loan_currency"]
end

#loan_descriptionString

Loan description

Returns:

  • (String)

    loan description



178
179
180
# File 'lib/friendly_score/user.rb', line 178

def loan_description
  @attributes["loan_description"]
end

#loan_duration_in_daysInteger

Loan duration

Returns:

  • (Integer)

    loan duration



185
186
187
# File 'lib/friendly_score/user.rb', line 185

def loan_duration_in_days
  @attributes["loan_duration_in_days"]
end

#mobileString

Mobile

Returns:

  • (String)

    mobile



192
193
194
# File 'lib/friendly_score/user.rb', line 192

def mobile
  @attributes["mobile"]
end

#nameString

Name

Returns:

  • (String)

    users name



21
22
23
# File 'lib/friendly_score/user.rb', line 21

def name
  @attributes["name"]
end

#positive?Boolean

Is user set as positive

Returns:

  • (Boolean)

    true if user is positive, false if not, nil if not set



148
149
150
151
# File 'lib/friendly_score/user.rb', line 148

def positive?
  return nil unless @attributes["is_positive"]
  @attributes["is_positive"].to_i == 1
end

#scoreyourself_mobileString

ScoreyourselfMobile

Returns:

  • (String)

    score yourself mobile



199
200
201
# File 'lib/friendly_score/user.rb', line 199

def scoreyourself_mobile
  @attributes["scoreyourself_mobile"]
end

#skillsString

Skills

Returns:

  • (String)

    skills



206
207
208
# File 'lib/friendly_score/user.rb', line 206

def skills
  @attributes["skills"]
end

#statusInteger

Status of the user

Returns:

  • (Integer)

    status of the user



213
214
215
# File 'lib/friendly_score/user.rb', line 213

def status
  @attributes["status"].to_i
end

#status_descriptionString

Status description

Returns:

  • (String)

    status description



220
221
222
# File 'lib/friendly_score/user.rb', line 220

def status_description
  @attributes["status_description"]
end

#working?Boolean

Is working

Returns:

  • (Boolean)

    true if user is working, false if not, nil if not set



156
157
158
159
# File 'lib/friendly_score/user.rb', line 156

def working?
  return nil unless @attributes["is_working"]
  @attributes["is_working"].to_i == 1
end