Class: MessengerPlatform::Attachment

Inherits:
Object
  • Object
show all
Defined in:
lib/messenger_platform/attachment.rb

Constant Summary collapse

VALID_TYPES =
%w(image video audio)

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(hash) ⇒ Attachment

Returns a new instance of Attachment.



7
8
9
10
# File 'lib/messenger_platform/attachment.rb', line 7

def initialize(hash)
  @url = hash[:url]
  @type = hash[:type]
end

Instance Attribute Details

#typeObject (readonly)

Returns the value of attribute type.



5
6
7
# File 'lib/messenger_platform/attachment.rb', line 5

def type
  @type
end

#urlObject (readonly)

Returns the value of attribute url.



5
6
7
# File 'lib/messenger_platform/attachment.rb', line 5

def url
  @url
end