Class: Abbu::Contact

Inherits:
Object
  • Object
show all
Defined in:
lib/abbu/contact.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeContact

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

#companyObject

Returns the value of attribute company.



6
7
8
# File 'lib/abbu/contact.rb', line 6

def company
  @company
end

#emailsObject

Returns the value of attribute emails.



6
7
8
# File 'lib/abbu/contact.rb', line 6

def emails
  @emails
end

#first_nameObject

Returns the value of attribute first_name.



6
7
8
# File 'lib/abbu/contact.rb', line 6

def first_name
  @first_name
end

#last_nameObject

Returns the value of attribute last_name.



6
7
8
# File 'lib/abbu/contact.rb', line 6

def last_name
  @last_name
end

#phonesObject

Returns the value of attribute phones.



6
7
8
# File 'lib/abbu/contact.rb', line 6

def phones
  @phones
end

Instance Method Details

#full_nameObject



13
14
15
# File 'lib/abbu/contact.rb', line 13

def full_name
  [first_name, last_name].compact.join(' ')
end

#inspectObject



22
23
24
# File 'lib/abbu/contact.rb', line 22

def inspect
  to_s
end

#to_sObject



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