Class: Whatsapp::Messages::Contacts::Org

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby/whatsapp/messages/contacts/org.rb

Overview

Represents the organization details of a contact message. All fields are optional.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(company: nil, department: nil, title: nil) ⇒ Org

Returns a new instance of Org.

Parameters:

  • company (String, nil) (defaults to: nil)
  • department (String, nil) (defaults to: nil)
  • title (String, nil) (defaults to: nil)


24
25
26
27
28
# File 'lib/ruby/whatsapp/messages/contacts/org.rb', line 24

def initialize(company: nil, department: nil, title: nil)
  @company = company
  @department = department
  @title = title
end

Instance Attribute Details

#companyString?

Returns:

  • (String, nil)


11
12
13
# File 'lib/ruby/whatsapp/messages/contacts/org.rb', line 11

def company
  @company
end

#departmentString?

Returns:

  • (String, nil)


15
16
17
# File 'lib/ruby/whatsapp/messages/contacts/org.rb', line 15

def department
  @department
end

#titleString?

Returns:

  • (String, nil)


19
20
21
# File 'lib/ruby/whatsapp/messages/contacts/org.rb', line 19

def title
  @title
end

Instance Method Details

#serializeHash

Returns The serialized org payload.

Returns:

  • (Hash)

    The serialized org payload.



31
32
33
34
35
36
37
# File 'lib/ruby/whatsapp/messages/contacts/org.rb', line 31

def serialize
  {
    company:,
    department:,
    title:,
  }.compact
end