Class: SpiffyStoresAPI::Image

Inherits:
Base show all
Defined in:
lib/spiffy_stores_api/resources/image.rb

Instance Method Summary collapse

Methods inherited from Base

activate_session, #as_json, clear_session, #encode, #headers, init_prefix, init_prefix_explicit, #persisted?

Methods included from Countable

#count

Methods inherited from ActiveResource::Base

delete, headers

Instance Method Details

#attach_image(data, filename = nil) ⇒ Object



11
12
13
14
# File 'lib/spiffy_stores_api/resources/image.rb', line 11

def attach_image(data, filename = nil)
  attributes['attachment'] = Base64.encode64(data)
  attributes['filename'] = filename unless filename.nil?
end