Class: Contacts::Contact
- Inherits:
-
Object
- Object
- Contacts::Contact
- Defined in:
- lib/contacts.rb
Instance Attribute Summary collapse
-
#emails ⇒ Object
readonly
Returns the value of attribute emails.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#username ⇒ Object
readonly
Returns the value of attribute username.
Instance Method Summary collapse
- #email ⇒ Object
-
#initialize(emails, name, username = "") ⇒ Contact
constructor
A new instance of Contact.
Constructor Details
#initialize(emails, name, username = "") ⇒ Contact
Returns a new instance of Contact.
32 33 34 35 36 |
# File 'lib/contacts.rb', line 32 def initialize(emails, name, username = "") @name = name @emails = Array(emails) @username = username end |
Instance Attribute Details
#emails ⇒ Object (readonly)
Returns the value of attribute emails.
30 31 32 |
# File 'lib/contacts.rb', line 30 def emails @emails end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
30 31 32 |
# File 'lib/contacts.rb', line 30 def name @name end |
#username ⇒ Object (readonly)
Returns the value of attribute username.
30 31 32 |
# File 'lib/contacts.rb', line 30 def username @username end |
Instance Method Details
#email ⇒ Object
38 39 40 |
# File 'lib/contacts.rb', line 38 def email @emails.first end |