Class: WhatsappSdk::Resource::Media

Inherits:
Object
  • Object
show all
Defined in:
lib/whatsapp_sdk/resource/media.rb

Defined Under Namespace

Modules: Type

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#file_sizeObject

Returns the value of attribute file_size.



14
15
16
# File 'lib/whatsapp_sdk/resource/media.rb', line 14

def file_size
  @file_size
end

#idObject

Returns the value of attribute id.



14
15
16
# File 'lib/whatsapp_sdk/resource/media.rb', line 14

def id
  @id
end

#messaging_productObject

Returns the value of attribute messaging_product.



14
15
16
# File 'lib/whatsapp_sdk/resource/media.rb', line 14

def messaging_product
  @messaging_product
end

#mime_typeObject

Returns the value of attribute mime_type.



14
15
16
# File 'lib/whatsapp_sdk/resource/media.rb', line 14

def mime_type
  @mime_type
end

#sha256Object

Returns the value of attribute sha256.



14
15
16
# File 'lib/whatsapp_sdk/resource/media.rb', line 14

def sha256
  @sha256
end

#urlObject

Returns the value of attribute url.



14
15
16
# File 'lib/whatsapp_sdk/resource/media.rb', line 14

def url
  @url
end

Class Method Details

.from_hash(hash) ⇒ Object



16
17
18
19
20
21
22
23
24
25
# File 'lib/whatsapp_sdk/resource/media.rb', line 16

def self.from_hash(hash)
  media = new
  media.id = hash["id"]
  media.file_size = hash["file_size"]
  media.messaging_product = hash["messaging_product"]
  media.mime_type = hash["mime_type"]
  media.sha256 = hash["sha256"]
  media.url = hash["url"]
  media
end

Instance Method Details

#==(other) ⇒ Object



27
28
29
30
31
32
33
34
# File 'lib/whatsapp_sdk/resource/media.rb', line 27

def ==(other)
  id == other.id &&
    file_size == other.file_size &&
    messaging_product == other.messaging_product &&
    mime_type == other.mime_type &&
    sha256 == other.sha256 &&
    url == other.url
end