Class: FacturX::Contact

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(person_name: nil, department_name: nil, phone: nil, email: nil) ⇒ Contact

Returns a new instance of Contact.



7
8
9
10
11
12
# File 'lib/factur_x/contact.rb', line 7

def initialize(person_name: nil, department_name: nil, phone: nil, email: nil)
  @person_name = person_name
  @department_name = department_name
  @phone = phone
  @email = email
end

Instance Attribute Details

#department_nameObject (readonly)

Returns the value of attribute department_name.



5
6
7
# File 'lib/factur_x/contact.rb', line 5

def department_name
  @department_name
end

#emailObject (readonly)

Returns the value of attribute email.



5
6
7
# File 'lib/factur_x/contact.rb', line 5

def email
  @email
end

#person_nameObject (readonly)

Returns the value of attribute person_name.



5
6
7
# File 'lib/factur_x/contact.rb', line 5

def person_name
  @person_name
end

#phoneObject (readonly)

Returns the value of attribute phone.



5
6
7
# File 'lib/factur_x/contact.rb', line 5

def phone
  @phone
end

Instance Method Details

#empty?Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/factur_x/contact.rb', line 14

def empty?
  [person_name, department_name, phone, email].all?(&:nil?)
end