lib/moysklad/resources.rb in moysklad-0.3.0 vs lib/moysklad/resources.rb in moysklad-0.3.1

- old
+ new

@@ -1,26 +1,39 @@ module Moysklad::Resources mattr_accessor :resources - extend ActiveSupport::Autoload - def self.register_resource resource_class self.resources ||= [] self.resources << resource_class end - require_relative 'resources/base' - require_relative 'resources/indexed' - require_relative 'resources/custom_entities' - require_relative 'resources/assortments' + %w{ + positions + base + load_all + assortments + custom_entities + custom_entity_metadata + embedded_entity_metadata + where_filter + indexed_cache + indexed + embedded_entity_metadata_indexed + products + stock + subresource + }.each do |m| + require_relative "resources/#{m}" + end # Простые ресурсы, которые создаются автоматически - %w{Products Productfolders Uoms PriceType Countries Variants + %w{Productfolders Uoms PriceType Countries Variants Counterparty Organization + Service + Bundle CustomerOrders Store Currency - Workflows - Companies Consignments MyCompanies}.each do |klass_name| + Consignments Group}.each do |klass_name| const_set klass_name, Class.new( Base ) end end