Sha256: 0876e47ea53371cecf59882b67911cb9c8ce5123c0b7f30cc6838e0c07b9a828

Contents?: true

Size: 598 Bytes

Versions: 6

Compression:

Stored size: 598 Bytes

Contents

module Moysklad::Resources
  class Stock < Base

    def listWithConsignments params={}
      list params.merge(showConsignments: true)
    end

    def all
      page.items
    end

    def find
      raise 'no such method'
    end

    def list_path
      'exchange/rest/stock/xml'
    end

    def self.entity_class
      Moysklad::Entities::StockTO
    end

    def self.pluralized_type
      :stock
    end

    private

    def parse_page content
      items = Moysklad::Entities::StockTO.parse content
      Moysklad::Entities::Page.new items, items.count, 0, items.count
    end

  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
moysklad-0.3.0 lib/moysklad/resources/stock.rb
moysklad-0.2.1 lib/moysklad/resources/stock.rb
moysklad-0.2.0 lib/moysklad/resources/stock.rb
moysklad-0.1.5 lib/moysklad/resources/stock.rb
moysklad-0.1.4 lib/moysklad/resources/stock.rb
moysklad-0.1.3 lib/moysklad/resources/stock.rb