lib/moysklad/resources.rb in moysklad-0.0.2 vs lib/moysklad/resources.rb in moysklad-0.1.1

- old
+ new

@@ -6,23 +6,19 @@ def self.register_resource resource_class self.resources ||= [] self.resources << resource_class end - autoload :Base - autoload :Cached - autoload :Indexed - + require_relative 'resources/base' + require_relative 'resources/indexed' require_relative 'resources/stock' + require_relative 'resources/metadata' + require_relative 'resources/custom_entity_metadata' + require_relative 'resources/metadata_indexed' + require_relative 'resources/subresource' - class Metadata < Base - def self.entity_class - Moysklad::Entities::EmbeddedEntityMetadata - end - end - # Простые ресурсы - %w{Goods Features CustomerOrders Warehouses Attributes Companies Consignments MyCompanies}.each do |klass_name| + %w{Goods GoodFolders Features CustomEntities CustomerOrders Warehouses Companies Consignments MyCompanies}.each do |klass_name| const_set klass_name, Class.new( Base ) end end