Class: BabyNames::Person
- Inherits:
-
Object
- Object
- BabyNames::Person
- Defined in:
- lib/babynames.rb
Instance Attribute Summary collapse
-
#email ⇒ Object
Returns the value of attribute email.
-
#first_name ⇒ Object
Returns the value of attribute first_name.
-
#gender ⇒ Object
Returns the value of attribute gender.
-
#last_name ⇒ Object
Returns the value of attribute last_name.
-
#middle_name ⇒ Object
Returns the value of attribute middle_name.
Instance Method Summary collapse
- #female? ⇒ Boolean
-
#initialize(params) ⇒ Person
constructor
A new instance of Person.
- #male? ⇒ Boolean
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
#email ⇒ Object
Returns the value of attribute email.
127 128 129 |
# File 'lib/babynames.rb', line 127 def email @email end |
#first_name ⇒ Object
Returns the value of attribute first_name.
127 128 129 |
# File 'lib/babynames.rb', line 127 def first_name @first_name end |
#gender ⇒ Object
Returns the value of attribute gender.
127 128 129 |
# File 'lib/babynames.rb', line 127 def gender @gender end |
#last_name ⇒ Object
Returns the value of attribute last_name.
127 128 129 |
# File 'lib/babynames.rb', line 127 def last_name @last_name end |
#middle_name ⇒ Object
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
139 140 141 |
# File 'lib/babynames.rb', line 139 def female? !male? end |
#male? ⇒ Boolean
135 136 137 |
# File 'lib/babynames.rb', line 135 def male? gender == :male end |