Class: Phyllo::Profile

Inherits:
Object
  • Object
show all
Defined in:
lib/phyllo/models/profile.rb

Overview

Represents the user profile object. The profile object contains information related to the identity of the user. The data in a profile is tied to a particular work platform account that the user has connected to via Phyllo.

Defined Under Namespace

Classes: EnumAttributeValidator

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ Profile

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash



251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
# File 'lib/phyllo/models/profile.rb', line 251

def initialize(attributes = {})
  if !attributes.is_a?(Hash)
    fail ArgumentError, "The input argument (attributes) must be a hash in `Phyllo::Profile` initialize method"
  end

  # check to see if the attribute exists and convert string to symbol for hash key
  attributes = attributes.each_with_object({}) { |(k, v), h|
    if !self.class.attribute_map.key?(k.to_sym)
      fail ArgumentError, "`#{k}` is not a valid attribute in `Phyllo::Profile`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
    end
    h[k.to_sym] = v
  }

  self.id = if attributes.key?(:id)
    attributes[:id]
  end

  self.created_at = if attributes.key?(:created_at)
    attributes[:created_at]
  end

  self.updated_at = if attributes.key?(:updated_at)
    attributes[:updated_at]
  end

  self.user = if attributes.key?(:user)
    attributes[:user]
  end

  self. = if attributes.key?(:account)
    attributes[:account]
  end

  self.work_platform = if attributes.key?(:work_platform)
    attributes[:work_platform]
  end

  self.platform_username = if attributes.key?(:platform_username)
    attributes[:platform_username]
  end

  if attributes.key?(:full_name)
    self.full_name = attributes[:full_name]
  end

  if attributes.key?(:first_name)
    self.first_name = attributes[:first_name]
  end

  if attributes.key?(:last_name)
    self.last_name = attributes[:last_name]
  end

  if attributes.key?(:nick_name)
    self.nick_name = attributes[:nick_name]
  end

  if attributes.key?(:url)
    self.url = attributes[:url]
  end

  if attributes.key?(:introduction)
    self.introduction = attributes[:introduction]
  end

  if attributes.key?(:image_url)
    self.image_url = attributes[:image_url]
  end

  if attributes.key?(:date_of_birth)
    self.date_of_birth = attributes[:date_of_birth]
  end

  if attributes.key?(:external_id)
    self.external_id = attributes[:external_id]
  end

  if attributes.key?(:platform_account_type)
    self. = attributes[:platform_account_type]
  end

  if attributes.key?(:category)
    self.category = attributes[:category]
  end

  if attributes.key?(:website)
    self.website = attributes[:website]
  end

  if attributes.key?(:reputation)
    self.reputation = attributes[:reputation]
  end

  if attributes.key?(:emails)
    if (value = attributes[:emails]).is_a?(Array)
      self.emails = value
    end
  end

  if attributes.key?(:phone_numbers)
    if (value = attributes[:phone_numbers]).is_a?(Array)
      self.phone_numbers = value
    end
  end

  if attributes.key?(:addresses)
    if (value = attributes[:addresses]).is_a?(Array)
      self.addresses = value
    end
  end

  self.gender = if attributes.key?(:gender)
    attributes[:gender]
  end

  if attributes.key?(:country)
    self.country = attributes[:country]
  end

  if attributes.key?(:platform_profile_name)
    self.platform_profile_name = attributes[:platform_profile_name]
  end

  if attributes.key?(:platform_profile_id)
    self.platform_profile_id = attributes[:platform_profile_id]
  end

  if attributes.key?(:platform_profile_published_at)
    self.platform_profile_published_at = attributes[:platform_profile_published_at]
  end

  if attributes.key?(:is_verified)
    self.is_verified = attributes[:is_verified]
  end

  if attributes.key?(:is_business)
    self.is_business = attributes[:is_business]
  end

  if attributes.key?(:work_experiences)
    if (value = attributes[:work_experiences]).is_a?(Array)
      self.work_experiences = value
    end
  end

  if attributes.key?(:education)
    if (value = attributes[:education]).is_a?(Array)
      self.education = value
    end
  end

  if attributes.key?(:publications)
    if (value = attributes[:publications]).is_a?(Array)
      self.publications = value
    end
  end

  if attributes.key?(:certifications)
    if (value = attributes[:certifications]).is_a?(Array)
      self.certifications = value
    end
  end

  if attributes.key?(:volunteer_experiences)
    if (value = attributes[:volunteer_experiences]).is_a?(Array)
      self.volunteer_experiences = value
    end
  end

  if attributes.key?(:honors)
    if (value = attributes[:honors]).is_a?(Array)
      self.honors = value
    end
  end

  if attributes.key?(:projects)
    if (value = attributes[:projects]).is_a?(Array)
      self.projects = value
    end
  end
end

Instance Attribute Details

#accountObject

Returns the value of attribute account.



28
29
30
# File 'lib/phyllo/models/profile.rb', line 28

def 
  @account
end

#addressesObject

Addresses object.



80
81
82
# File 'lib/phyllo/models/profile.rb', line 80

def addresses
  @addresses
end

#categoryObject

Category of the user’s platform account. Ex - For Instagram it’s the page type which could be beauty, fitness etc



66
67
68
# File 'lib/phyllo/models/profile.rb', line 66

def category
  @category
end

#certificationsObject

Returns the value of attribute certifications.



109
110
111
# File 'lib/phyllo/models/profile.rb', line 109

def certifications
  @certifications
end

#countryObject

Country of the user on the connected platform.



86
87
88
# File 'lib/phyllo/models/profile.rb', line 86

def country
  @country
end

#created_atObject

Profile creation time (UTC date and time in ISO 8601 format)



21
22
23
# File 'lib/phyllo/models/profile.rb', line 21

def created_at
  @created_at
end

#date_of_birthObject

Date of birth of the user on the platform.



57
58
59
# File 'lib/phyllo/models/profile.rb', line 57

def date_of_birth
  @date_of_birth
end

#educationObject

Returns the value of attribute education.



105
106
107
# File 'lib/phyllo/models/profile.rb', line 105

def education
  @education
end

#emailsObject

Emails object.



74
75
76
# File 'lib/phyllo/models/profile.rb', line 74

def emails
  @emails
end

#external_idObject

Unique identifier for the profile on the platform.



60
61
62
# File 'lib/phyllo/models/profile.rb', line 60

def external_id
  @external_id
end

#first_nameObject

First name of the user profile.



39
40
41
# File 'lib/phyllo/models/profile.rb', line 39

def first_name
  @first_name
end

#full_nameObject

Full name of the user profile.



36
37
38
# File 'lib/phyllo/models/profile.rb', line 36

def full_name
  @full_name
end

#genderObject

Gender of the user.



83
84
85
# File 'lib/phyllo/models/profile.rb', line 83

def gender
  @gender
end

#honorsObject

Returns the value of attribute honors.



113
114
115
# File 'lib/phyllo/models/profile.rb', line 113

def honors
  @honors
end

#idObject

Unique ID of the profile.



18
19
20
# File 'lib/phyllo/models/profile.rb', line 18

def id
  @id
end

#image_urlObject

URL of the profile image on the platform.



54
55
56
# File 'lib/phyllo/models/profile.rb', line 54

def image_url
  @image_url
end

#introductionObject

Description of the profile. Ex - For Instagram it’s the bio and for YouTube it’s the channel introduction.



51
52
53
# File 'lib/phyllo/models/profile.rb', line 51

def introduction
  @introduction
end

#is_businessObject

true if the user”s profile is business account on the platform.



101
102
103
# File 'lib/phyllo/models/profile.rb', line 101

def is_business
  @is_business
end

#is_verifiedObject

true if the user”s profile is verified by the platform.



98
99
100
# File 'lib/phyllo/models/profile.rb', line 98

def is_verified
  @is_verified
end

#last_nameObject

Last name of the user profile.



42
43
44
# File 'lib/phyllo/models/profile.rb', line 42

def last_name
  @last_name
end

#nick_nameObject

Nickname of the user profile.



45
46
47
# File 'lib/phyllo/models/profile.rb', line 45

def nick_name
  @nick_name
end

#phone_numbersObject

Phone numbers object.



77
78
79
# File 'lib/phyllo/models/profile.rb', line 77

def phone_numbers
  @phone_numbers
end

#platform_account_typeObject

Account type of the user on the platform.



63
64
65
# File 'lib/phyllo/models/profile.rb', line 63

def 
  @platform_account_type
end

#platform_profile_idObject

Unique profile ID of the user on the work platform. Ex - For YouTube it’s the channel ID and for Instagram it’s the Instagram page ID.



92
93
94
# File 'lib/phyllo/models/profile.rb', line 92

def platform_profile_id
  @platform_profile_id
end

#platform_profile_nameObject

User’s profile name on the work platform. This is not unique, is displayed prominently on the profile, usually editable and is most commonly associated with that user’s identity on the platform. Ex - For YouTube, it’s the channel name displayed on the channel page and for Instagram / Twitter / TikTok etc, it’s the name displayed on the user’s profile page.



89
90
91
# File 'lib/phyllo/models/profile.rb', line 89

def platform_profile_name
  @platform_profile_name
end

#platform_profile_published_atObject

Timestamp when the profile was created on the platform.



95
96
97
# File 'lib/phyllo/models/profile.rb', line 95

def platform_profile_published_at
  @platform_profile_published_at
end

#platform_usernameObject

Username of the connected account. This is used to uniquely identify a user on any platform and usually the name that is present in the URLs, used to tag a user etc. Ex - For YouTube, it’s the channel name in the URL and for Instagram / Twitter / TikTok etc, it’s the handle.



33
34
35
# File 'lib/phyllo/models/profile.rb', line 33

def platform_username
  @platform_username
end

#projectsObject

Returns the value of attribute projects.



115
116
117
# File 'lib/phyllo/models/profile.rb', line 115

def projects
  @projects
end

#publicationsObject

Returns the value of attribute publications.



107
108
109
# File 'lib/phyllo/models/profile.rb', line 107

def publications
  @publications
end

#reputationObject

Returns the value of attribute reputation.



71
72
73
# File 'lib/phyllo/models/profile.rb', line 71

def reputation
  @reputation
end

#updated_atObject

Profile updation time (UTC date and time in ISO 8601 format)



24
25
26
# File 'lib/phyllo/models/profile.rb', line 24

def updated_at
  @updated_at
end

#urlObject

Profile URL on the connected platform.



48
49
50
# File 'lib/phyllo/models/profile.rb', line 48

def url
  @url
end

#userObject

Returns the value of attribute user.



26
27
28
# File 'lib/phyllo/models/profile.rb', line 26

def user
  @user
end

#volunteer_experiencesObject

Returns the value of attribute volunteer_experiences.



111
112
113
# File 'lib/phyllo/models/profile.rb', line 111

def volunteer_experiences
  @volunteer_experiences
end

#websiteObject

User website listed on the platform.



69
70
71
# File 'lib/phyllo/models/profile.rb', line 69

def website
  @website
end

#work_experiencesObject

Returns the value of attribute work_experiences.



103
104
105
# File 'lib/phyllo/models/profile.rb', line 103

def work_experiences
  @work_experiences
end

#work_platformObject

Returns the value of attribute work_platform.



30
31
32
# File 'lib/phyllo/models/profile.rb', line 30

def work_platform
  @work_platform
end

Class Method Details

._deserialize(type, value) ⇒ Object

Deserializes the data based on type

Parameters:

  • string

    type Data type

  • string

    value Value to be deserialized

Returns:

  • (Object)

    Deserialized data



573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
# File 'lib/phyllo/models/profile.rb', line 573

def self._deserialize(type, value)
  case type.to_sym
  when :Time
    Time.parse(value)
  when :Date
    Date.parse(value)
  when :String
    value.to_s
  when :Integer
    value.to_i
  when :Float
    value.to_f
  when :Boolean
    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
      true
    else
      false
    end
  when :Object
    # generic object (usually a Hash), return directly
    value
  when /\AArray<(?<inner_type>.+)>\z/
    inner_type = Regexp.last_match[:inner_type]
    value.map { |v| _deserialize(inner_type, v) }
  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
    k_type = Regexp.last_match[:k_type]
    v_type = Regexp.last_match[:v_type]
    {}.tap do |hash|
      value.each do |k, v|
        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
      end
    end
  else # model
    # models (e.g. Pet) or oneOf
    klass = Phyllo.const_get(type)
    (klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of)) ? klass.build(value) : klass.build_from_hash(value)
  end
end

.acceptable_attributesObject

Returns all the JSON keys this model knows about



183
184
185
# File 'lib/phyllo/models/profile.rb', line 183

def self.acceptable_attributes
  attribute_map.values
end

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
# File 'lib/phyllo/models/profile.rb', line 140

def self.attribute_map
  {
    id: :id,
    created_at: :created_at,
    updated_at: :updated_at,
    user: :user,
    account: :account,
    work_platform: :work_platform,
    platform_username: :platform_username,
    full_name: :full_name,
    first_name: :first_name,
    last_name: :last_name,
    nick_name: :nick_name,
    url: :url,
    introduction: :introduction,
    image_url: :image_url,
    date_of_birth: :date_of_birth,
    external_id: :external_id,
    platform_account_type: :platform_account_type,
    category: :category,
    website: :website,
    reputation: :reputation,
    emails: :emails,
    phone_numbers: :phone_numbers,
    addresses: :addresses,
    gender: :gender,
    country: :country,
    platform_profile_name: :platform_profile_name,
    platform_profile_id: :platform_profile_id,
    platform_profile_published_at: :platform_profile_published_at,
    is_verified: :is_verified,
    is_business: :is_business,
    work_experiences: :work_experiences,
    education: :education,
    publications: :publications,
    certifications: :certifications,
    volunteer_experiences: :volunteer_experiences,
    honors: :honors,
    projects: :projects
  }
end

.build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
# File 'lib/phyllo/models/profile.rb', line 549

def self.build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  attributes = attributes.transform_keys(&:to_sym)
  transformed_hash = {}
  openapi_types.each_pair do |key, type|
    if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
      transformed_hash[key.to_s] = nil
    elsif type =~ /\AArray<(.*)>/i
      # check to ensure the input is an array given that the attribute
      # is documented as an array but the input is not
      if attributes[attribute_map[key]].is_a?(Array)
        transformed_hash[key.to_s] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
      end
    elsif !attributes[attribute_map[key]].nil?
      transformed_hash[key.to_s] = _deserialize(type, attributes[attribute_map[key]])
    end
  end
  new(transformed_hash)
end

.openapi_nullableObject

List of attributes with nullable: true



231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
# File 'lib/phyllo/models/profile.rb', line 231

def self.openapi_nullable
  Set.new([
    :platform_username,
    :full_name,
    :first_name,
    :last_name,
    :nick_name,
    :introduction,
    :platform_account_type,
    :category,
    :website,
    :gender,
    :platform_profile_name,
    :platform_profile_id,
    :platform_profile_published_at
  ])
end

.openapi_typesObject

Attribute type mapping.



188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
# File 'lib/phyllo/models/profile.rb', line 188

def self.openapi_types
  {
    id: :String,
    created_at: :Time,
    updated_at: :Time,
    user: :UserAttribute1,
    account: :AccountAttribute1,
    work_platform: :WorkPlatformAttribute1,
    platform_username: :String,
    full_name: :String,
    first_name: :String,
    last_name: :String,
    nick_name: :String,
    url: :String,
    introduction: :String,
    image_url: :String,
    date_of_birth: :String,
    external_id: :String,
    platform_account_type: :String,
    category: :String,
    website: :String,
    reputation: :Profile1Reputation,
    emails: :"Array<Profile1EmailsInner>",
    phone_numbers: :"Array<Profile1PhoneNumbersInner>",
    addresses: :"Array<Profile1AddressesInner>",
    gender: :String,
    country: :String,
    platform_profile_name: :String,
    platform_profile_id: :String,
    platform_profile_published_at: :Time,
    is_verified: :Boolean,
    is_business: :Boolean,
    work_experiences: :"Array<WorkExperience1>",
    education: :"Array<Education1>",
    publications: :"Array<Publications1>",
    certifications: :"Array<Certifications1>",
    volunteer_experiences: :"Array<VolunteerExperiences1>",
    honors: :"Array<Honors1>",
    projects: :"Array<Projects1>"
  }
end

Instance Method Details

#==(other) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
# File 'lib/phyllo/models/profile.rb', line 492

def ==(other)
  return true if equal?(other)
  self.class == other.class &&
    id == other.id &&
    created_at == other.created_at &&
    updated_at == other.updated_at &&
    user == other.user &&
     == other. &&
    work_platform == other.work_platform &&
    platform_username == other.platform_username &&
    full_name == other.full_name &&
    first_name == other.first_name &&
    last_name == other.last_name &&
    nick_name == other.nick_name &&
    url == other.url &&
    introduction == other.introduction &&
    image_url == other.image_url &&
    date_of_birth == other.date_of_birth &&
    external_id == other.external_id &&
     == other. &&
    category == other.category &&
    website == other.website &&
    reputation == other.reputation &&
    emails == other.emails &&
    phone_numbers == other.phone_numbers &&
    addresses == other.addresses &&
    gender == other.gender &&
    country == other.country &&
    platform_profile_name == other.platform_profile_name &&
    platform_profile_id == other.platform_profile_id &&
    platform_profile_published_at == other.platform_profile_published_at &&
    is_verified == other.is_verified &&
    is_business == other.is_business &&
    work_experiences == other.work_experiences &&
    education == other.education &&
    publications == other.publications &&
    certifications == other.certifications &&
    volunteer_experiences == other.volunteer_experiences &&
    honors == other.honors &&
    projects == other.projects
end

#_to_hash(value) ⇒ Hash

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

Parameters:

  • value (Object)

    Any valid value

Returns:

  • (Hash)

    Returns the value in the form of hash



644
645
646
647
648
649
650
651
652
653
654
655
656
# File 'lib/phyllo/models/profile.rb', line 644

def _to_hash(value)
  if value.is_a?(Array)
    value.compact.map { |v| _to_hash(v) }
  elsif value.is_a?(Hash)
    {}.tap do |hash|
      value.each { |k, v| hash[k] = _to_hash(v) }
    end
  elsif value.respond_to? :to_hash
    value.to_hash
  else
    value
  end
end

#eql?(other) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


536
537
538
# File 'lib/phyllo/models/profile.rb', line 536

def eql?(other)
  self == other
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



542
543
544
# File 'lib/phyllo/models/profile.rb', line 542

def hash
  [id, created_at, updated_at, user, , work_platform, platform_username, full_name, first_name, last_name, nick_name, url, introduction, image_url, date_of_birth, external_id, , category, website, reputation, emails, phone_numbers, addresses, gender, country, platform_profile_name, platform_profile_id, platform_profile_published_at, is_verified, is_business, work_experiences, education, publications, certifications, volunteer_experiences, honors, projects].hash
end

#list_invalid_propertiesObject

Show invalid properties with the reasons. Usually used together with valid?

Returns:

  • Array for valid properties with the reasons



435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
# File 'lib/phyllo/models/profile.rb', line 435

def list_invalid_properties
  warn "[DEPRECATED] the `list_invalid_properties` method is obsolete"
  invalid_properties = []
  if @id.nil?
    invalid_properties.push('invalid value for "id", id cannot be nil.')
  end

  if @created_at.nil?
    invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
  end

  if @updated_at.nil?
    invalid_properties.push('invalid value for "updated_at", updated_at cannot be nil.')
  end

  if @user.nil?
    invalid_properties.push('invalid value for "user", user cannot be nil.')
  end

  if @account.nil?
    invalid_properties.push('invalid value for "account", account cannot be nil.')
  end

  if @work_platform.nil?
    invalid_properties.push('invalid value for "work_platform", work_platform cannot be nil.')
  end

  invalid_properties
end

#to_bodyHash

to_body is an alias to to_hash (backward compatibility)

Returns:

  • (Hash)

    Returns the object in the form of hash



620
621
622
# File 'lib/phyllo/models/profile.rb', line 620

def to_body
  to_hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



626
627
628
629
630
631
632
633
634
635
636
637
638
# File 'lib/phyllo/models/profile.rb', line 626

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = send(attr)
    if value.nil?
      is_nullable = self.class.openapi_nullable.include?(attr)
      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
    end

    hash[param] = _to_hash(value)
  end
  hash
end

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



614
615
616
# File 'lib/phyllo/models/profile.rb', line 614

def to_s
  to_hash.to_s
end

#valid?Boolean

Check to see if the all the properties in the model are valid

Returns:

  • (Boolean)

    true if the model is valid



467
468
469
470
471
472
473
474
475
476
477
478
# File 'lib/phyllo/models/profile.rb', line 467

def valid?
  warn "[DEPRECATED] the `valid?` method is obsolete"
  return false if @id.nil?
  return false if @created_at.nil?
  return false if @updated_at.nil?
  return false if @user.nil?
  return false if @account.nil?
  return false if @work_platform.nil?
  gender_validator = EnumAttributeValidator.new("String", ["MALE", "FEMALE", "OTHER", "UNSPECIFIED"])
  return false unless gender_validator.valid?(@gender)
  true
end