Class: Abbu::Contact
- Inherits:
-
Object
- Object
- Abbu::Contact
- Defined in:
- lib/abbu/contact.rb
Instance Attribute Summary collapse
-
#company ⇒ Object
Returns the value of attribute company.
-
#emails ⇒ Object
Returns the value of attribute emails.
-
#first_name ⇒ Object
Returns the value of attribute first_name.
-
#last_name ⇒ Object
Returns the value of attribute last_name.
-
#phones ⇒ Object
Returns the value of attribute phones.
Instance Method Summary collapse
- #full_name ⇒ Object
-
#initialize ⇒ Contact
constructor
A new instance of Contact.
- #inspect ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize ⇒ Contact
Returns a new instance of Contact.
8 9 10 11 |
# File 'lib/abbu/contact.rb', line 8 def initialize @emails = [] @phones = [] end |
Instance Attribute Details
#company ⇒ Object
Returns the value of attribute company.
6 7 8 |
# File 'lib/abbu/contact.rb', line 6 def company @company end |
#emails ⇒ Object
Returns the value of attribute emails.
6 7 8 |
# File 'lib/abbu/contact.rb', line 6 def emails @emails end |
#first_name ⇒ Object
Returns the value of attribute first_name.
6 7 8 |
# File 'lib/abbu/contact.rb', line 6 def first_name @first_name end |
#last_name ⇒ Object
Returns the value of attribute last_name.
6 7 8 |
# File 'lib/abbu/contact.rb', line 6 def last_name @last_name end |
#phones ⇒ Object
Returns the value of attribute phones.
6 7 8 |
# File 'lib/abbu/contact.rb', line 6 def phones @phones end |
Instance Method Details
#full_name ⇒ Object
13 14 15 |
# File 'lib/abbu/contact.rb', line 13 def full_name [first_name, last_name].compact.join(' ') end |
#inspect ⇒ Object
22 23 24 |
# File 'lib/abbu/contact.rb', line 22 def inspect to_s end |
#to_s ⇒ Object
17 18 19 20 |
# File 'lib/abbu/contact.rb', line 17 def to_s "#<Abbu::Contact first_name=#{first_name.inspect} last_name=#{last_name.inspect} " \ "emails=#{emails.inspect} phones=#{phones.inspect}>" end |