Class: Bond::MessagePreview
- Defined in:
- lib/bond/preview/message_preview.rb
Instance Attribute Summary collapse
-
#encoded_content ⇒ Object
Returns the value of attribute encoded_content.
-
#encoded_content_hash ⇒ Object
Returns the value of attribute encoded_content_hash.
-
#encoded_content_timestamp ⇒ Object
Returns the value of attribute encoded_content_timestamp.
-
#img ⇒ Object
Returns the value of attribute img.
Attributes inherited from Preview
Instance Method Summary collapse
-
#request_preview ⇒ Hash
Attributes.
Methods inherited from Preview
Constructor Details
This class inherits a constructor from Bond::Preview
Instance Attribute Details
#encoded_content ⇒ Object
Returns the value of attribute encoded_content.
6 7 8 |
# File 'lib/bond/preview/message_preview.rb', line 6 def encoded_content @encoded_content end |
#encoded_content_hash ⇒ Object
Returns the value of attribute encoded_content_hash.
6 7 8 |
# File 'lib/bond/preview/message_preview.rb', line 6 def encoded_content_hash @encoded_content_hash end |
#encoded_content_timestamp ⇒ Object
Returns the value of attribute encoded_content_timestamp.
6 7 8 |
# File 'lib/bond/preview/message_preview.rb', line 6 def end |
#img ⇒ Object
Returns the value of attribute img.
6 7 8 |
# File 'lib/bond/preview/message_preview.rb', line 6 def img @img end |
Instance Method Details
#request_preview ⇒ Hash
Returns attributes.
9 10 11 12 13 14 15 16 17 18 |
# File 'lib/bond/preview/message_preview.rb', line 9 def request_preview response = Bond::Connection.connection.post('/messages/preview/content', request_params) json = JSON.parse(response.body) Bond::BondError.handle_errors(json) attributes = json['data'] attributes.each { |name, value| instance_variable_set("@#{name}", value) } attributes end |