Class: MessengerPlatform::Attachment
- Inherits:
-
Object
- Object
- MessengerPlatform::Attachment
- Defined in:
- lib/messenger_platform/attachment.rb
Constant Summary collapse
- VALID_TYPES =
%w(image video audio)
Instance Attribute Summary collapse
-
#type ⇒ Object
readonly
Returns the value of attribute type.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
-
#initialize(hash) ⇒ Attachment
constructor
A new instance of Attachment.
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
#type ⇒ Object (readonly)
Returns the value of attribute type.
5 6 7 |
# File 'lib/messenger_platform/attachment.rb', line 5 def type @type end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
5 6 7 |
# File 'lib/messenger_platform/attachment.rb', line 5 def url @url end |