Class: BabyNames::Person

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params) ⇒ Person

Returns a new instance of Person.



129
130
131
132
133
# File 'lib/babynames.rb', line 129

def initialize(params)
  params.each do |key, value|
    send("#{key}=", value)
  end
end

Instance Attribute Details

#emailObject

Returns the value of attribute email.



127
128
129
# File 'lib/babynames.rb', line 127

def email
  @email
end

#first_nameObject

Returns the value of attribute first_name.



127
128
129
# File 'lib/babynames.rb', line 127

def first_name
  @first_name
end

#genderObject

Returns the value of attribute gender.



127
128
129
# File 'lib/babynames.rb', line 127

def gender
  @gender
end

#last_nameObject

Returns the value of attribute last_name.



127
128
129
# File 'lib/babynames.rb', line 127

def last_name
  @last_name
end

#middle_nameObject

Returns the value of attribute middle_name.



127
128
129
# File 'lib/babynames.rb', line 127

def middle_name
  @middle_name
end

Instance Method Details

#female?Boolean

Returns:

  • (Boolean)


139
140
141
# File 'lib/babynames.rb', line 139

def female?
  !male?
end

#male?Boolean

Returns:

  • (Boolean)


135
136
137
# File 'lib/babynames.rb', line 135

def male?
  gender == :male
end