Class: WhatsappSdk::Resource::Template
- Inherits:
-
Object
- Object
- WhatsappSdk::Resource::Template
- Defined in:
- lib/whatsapp_sdk/resource/template.rb
Defined Under Namespace
Instance Attribute Summary collapse
-
#category ⇒ Object
Returns the value of attribute category.
-
#components_json ⇒ Object
Returns the value of attribute components_json.
-
#id ⇒ Object
Returns the value of attribute id.
-
#language ⇒ Object
Returns the value of attribute language.
-
#name ⇒ Object
Returns the value of attribute name.
-
#status ⇒ Object
Returns the value of attribute status.
Class Method Summary collapse
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(id:, status:, category:, language: nil, name: nil, components_json: nil) ⇒ Template
constructor
A new instance of Template.
Constructor Details
#initialize(id:, status:, category:, language: nil, name: nil, components_json: nil) ⇒ Template
41 42 43 44 45 46 47 48 |
# File 'lib/whatsapp_sdk/resource/template.rb', line 41 def initialize(id:, status:, category:, language: nil, name: nil, components_json: nil) @id = id @status = status @category = category @language = language @name = name @components_json = components_json end |
Instance Attribute Details
#category ⇒ Object
Returns the value of attribute category.
39 40 41 |
# File 'lib/whatsapp_sdk/resource/template.rb', line 39 def category @category end |
#components_json ⇒ Object
Returns the value of attribute components_json.
39 40 41 |
# File 'lib/whatsapp_sdk/resource/template.rb', line 39 def components_json @components_json end |
#id ⇒ Object
Returns the value of attribute id.
39 40 41 |
# File 'lib/whatsapp_sdk/resource/template.rb', line 39 def id @id end |
#language ⇒ Object
Returns the value of attribute language.
39 40 41 |
# File 'lib/whatsapp_sdk/resource/template.rb', line 39 def language @language end |
#name ⇒ Object
Returns the value of attribute name.
39 40 41 |
# File 'lib/whatsapp_sdk/resource/template.rb', line 39 def name @name end |
#status ⇒ Object
Returns the value of attribute status.
39 40 41 |
# File 'lib/whatsapp_sdk/resource/template.rb', line 39 def status @status end |
Class Method Details
.from_hash(hash) ⇒ Object
50 51 52 53 54 55 56 57 58 59 |
# File 'lib/whatsapp_sdk/resource/template.rb', line 50 def self.from_hash(hash) new( id: hash["id"], status: hash["status"], category: hash["category"], language: hash["language"], name: hash["name"], components_json: hash["components"] ) end |
Instance Method Details
#==(other) ⇒ Object
61 62 63 64 65 66 67 68 |
# File 'lib/whatsapp_sdk/resource/template.rb', line 61 def ==(other) id == other.id && status == other.status && category == other.category && language == other.language && name == other.name && components_json == other.components_json end |