Sha256: 43b384d83dc624fb7c97d6b4618d37f9293a71e6f1660dd729b07d7726d5e4a7

Contents?: true

Size: 851 Bytes

Versions: 5

Compression:

Stored size: 851 Bytes

Contents

module Moysklad::Resources
  mattr_accessor :resources

  def self.register_resource resource_class
    self.resources ||= []
    self.resources << resource_class
  end

  %w{
    positions
    base
    load_all
    assortments
    custom_entities
    custom_entity_metadata
    product_images
    embedded_entity_metadata
    where_filter
    indexed_cache
    indexed
    embedded_entity_metadata_indexed
    products
    stock
    subresource
  }.each do |m|
    require_relative "resources/#{m}"
  end

  # Простые ресурсы, которые создаются автоматически
  %w{Productfolders Uoms PriceType Countries Variants
    Counterparty
    Organization
    Service
    Bundle
    CustomerOrders Store
    Currency
    Consignments Group}.each do |klass_name|
    const_set klass_name, Class.new( Base )
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
moysklad-0.5 lib/moysklad/resources.rb
moysklad-0.4.10 lib/moysklad/resources.rb
moysklad-0.4.9 lib/moysklad/resources.rb
moysklad-0.4.8 lib/moysklad/resources.rb
moysklad-0.4.7 lib/moysklad/resources.rb