Class: Mannequin::Person
- Inherits:
-
Object
- Object
- Mannequin::Person
- Defined in:
- lib/mannequin/person.rb
Instance Attribute Summary collapse
-
#email_address ⇒ Object
readonly
Returns the value of attribute email_address.
-
#first_name ⇒ Object
readonly
Returns the value of attribute first_name.
-
#last_name ⇒ Object
readonly
Returns the value of attribute last_name.
-
#middle_initial ⇒ Object
readonly
Returns the value of attribute middle_initial.
-
#middle_name ⇒ Object
readonly
Returns the value of attribute middle_name.
Instance Method Summary collapse
-
#initialize ⇒ Person
constructor
A new instance of Person.
Constructor Details
#initialize ⇒ Person
Returns a new instance of Person.
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/mannequin/person.rb', line 5 def initialize # Set variables from functions first_name = generated_first_name middle_name = generated_middle_name middle_initial = middle_name[0,1] last_name = generated_last_name email_address = "#{first_name.downcase}@#{last_name.downcase}.#{['com', 'net', 'org'].sample}" # Initialize attributes @first_name = first_name @middle_name = middle_name @middle_initial = middle_initial @last_name = last_name @email_address = email_address end |
Instance Attribute Details
#email_address ⇒ Object (readonly)
Returns the value of attribute email_address.
3 4 5 |
# File 'lib/mannequin/person.rb', line 3 def email_address @email_address end |
#first_name ⇒ Object (readonly)
Returns the value of attribute first_name.
3 4 5 |
# File 'lib/mannequin/person.rb', line 3 def first_name @first_name end |
#last_name ⇒ Object (readonly)
Returns the value of attribute last_name.
3 4 5 |
# File 'lib/mannequin/person.rb', line 3 def last_name @last_name end |
#middle_initial ⇒ Object (readonly)
Returns the value of attribute middle_initial.
3 4 5 |
# File 'lib/mannequin/person.rb', line 3 def middle_initial @middle_initial end |
#middle_name ⇒ Object (readonly)
Returns the value of attribute middle_name.
3 4 5 |
# File 'lib/mannequin/person.rb', line 3 def middle_name @middle_name end |