Class: Whatsapp::Webhook::Message::Contacts::Org

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

Overview

The organization details of an inbound contact card.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of Org.



21
22
23
24
25
# File 'lib/ruby/whatsapp/webhook/message/contacts/org.rb', line 21

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/webhook/message/contacts/org.rb', line 11

def company
  @company
end

#departmentString?

Returns:

  • (String, nil)


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

def department
  @department
end

#titleString?

Returns:

  • (String, nil)


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

def title
  @title
end

Class Method Details

.deserialize(data) ⇒ Org

Parameters:

  • data (Hash, nil)

    The raw org hash.

Returns:



30
31
32
33
34
# File 'lib/ruby/whatsapp/webhook/message/contacts/org.rb', line 30

def deserialize(data)
  data ||= {}

  new(company: data["company"], department: data["department"], title: data["title"])
end