Sha256: 3632d3cbce1561bb56481cf4a23eeaae2cca25545b44a7b7e0cb7c6143921653

Contents?: true

Size: 588 Bytes

Versions: 1

Compression:

Stored size: 588 Bytes

Contents

module AmoCRM::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
      AmoCRM::Entities::StockTO
    end

    def self.resource_name
      :stock
    end

    private

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

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
amo_crm-0.2.2 lib/amo_crm/resources/stock.rb