Class: KittyNames::Kitty
- Inherits:
-
Object
- Object
- KittyNames::Kitty
- Defined in:
- lib/kittynames.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.
Instance Method Summary collapse
- #female? ⇒ Boolean
-
#initialize(params) ⇒ Kitty
constructor
A new instance of Kitty.
- #male? ⇒ Boolean
Constructor Details
#initialize(params) ⇒ Kitty
Returns a new instance of Kitty.
123 124 125 126 127 |
# File 'lib/kittynames.rb', line 123 def initialize(params) params.each do |key, value| send("#{key}=", value) end end |
Instance Attribute Details
#email ⇒ Object
Returns the value of attribute email.
121 122 123 |
# File 'lib/kittynames.rb', line 121 def email @email end |
#first_name ⇒ Object
Returns the value of attribute first_name.
121 122 123 |
# File 'lib/kittynames.rb', line 121 def first_name @first_name end |
#gender ⇒ Object
Returns the value of attribute gender.
121 122 123 |
# File 'lib/kittynames.rb', line 121 def gender @gender end |
#last_name ⇒ Object
Returns the value of attribute last_name.
121 122 123 |
# File 'lib/kittynames.rb', line 121 def last_name @last_name end |
Instance Method Details
#female? ⇒ Boolean
133 134 135 |
# File 'lib/kittynames.rb', line 133 def female? !male? end |
#male? ⇒ Boolean
129 130 131 |
# File 'lib/kittynames.rb', line 129 def male? gender == :male end |