class Bond::MessagePreview

Attributes

encoded_content[RW]
encoded_content_hash[RW]
encoded_content_timestamp[RW]
img[RW]

Public Instance Methods

request_preview() click to toggle source

@return [Hash] attributes

# 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