Class: InsalesApi::Variant

Inherits:
Base
  • Object
show all
Defined in:
lib/insales_api/variant.rb

Class Method Summary collapse

Methods inherited from Base

configure, dump_config, for_account, restore_config

Methods included from Resource::Countable

#count

Methods included from Resource::Paginated

#find_each, #find_in_batches

Class Method Details

.group_update(variants) ⇒ Object

Updates all given variants. variants should be array:

[
  {
    id: 1,
    price: 340,
    quantity: 4,
  },
  {
    id: 2,
    price: 350,
    quantity: 5,
  },
]


18
19
20
# File 'lib/insales_api/variant.rb', line 18

def group_update(variants)
  put(:group_update, {}, format.encode(variants, root: :variants))
end