Class: Bond::EnvelopePreview
- Defined in:
- lib/bond/preview/envelope_preview.rb
Instance Attribute Summary collapse
-
#encoded_envelope ⇒ Object
Returns the value of attribute encoded_envelope.
-
#encoded_envelope_hash ⇒ Object
Returns the value of attribute encoded_envelope_hash.
-
#encoded_envelope_timestamp ⇒ Object
Returns the value of attribute encoded_envelope_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_envelope ⇒ Object
Returns the value of attribute encoded_envelope.
6 7 8 |
# File 'lib/bond/preview/envelope_preview.rb', line 6 def encoded_envelope @encoded_envelope end |
#encoded_envelope_hash ⇒ Object
Returns the value of attribute encoded_envelope_hash.
6 7 8 |
# File 'lib/bond/preview/envelope_preview.rb', line 6 def encoded_envelope_hash @encoded_envelope_hash end |
#encoded_envelope_timestamp ⇒ Object
Returns the value of attribute encoded_envelope_timestamp.
6 7 8 |
# File 'lib/bond/preview/envelope_preview.rb', line 6 def end |
#img ⇒ Object
Returns the value of attribute img.
6 7 8 |
# File 'lib/bond/preview/envelope_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/envelope_preview.rb', line 9 def request_preview response = Bond::Connection.connection.post('/messages/preview/envelope', 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 |