Module: Lucid::Shopify::Resource::Update

Defined in:
lib/lucid/shopify/resource/update.rb

Overview

Examples:

class OrderRepository
  include Lucid::Shopify::Resource::Update

  resource :orders

  # ...
end

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object

Parameters:

  • base (Class, Module)


18
19
20
# File 'lib/lucid/shopify/resource/update.rb', line 18

def self.included(base)
  base.include(Base)
end

Instance Method Details

#update(credentials, id, data) ⇒ Object

Parameters:

  • credentials (Credentials)
  • id (Integer)
  • data (Hash)


25
26
27
28
29
# File 'lib/lucid/shopify/resource/update.rb', line 25

def update(credentials, id, data)
  client.put_json(credentials, "#{resource}/#{id}", resource_singular => data).tap do
    logger.info("Updated #{resource_singular} id=#{id}")
  end
end