Class: ShopifyAPI::Image

Inherits:
Base
  • Object
show all
Defined in:
lib/shopify_api/resources/image.rb

Instance Method Summary collapse

Methods inherited from Base

activate_session, api_version, api_version=, #as_json, clear_session, #encode, #headers, init_prefix, init_prefix_explicit, #persisted?, prefix, prefix=, prefix_source, resource_prefix, resource_prefix=

Methods included from Countable

#count

Instance Method Details

#attach_image(data, filename = nil) ⇒ Object



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

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