Sha256: 73784e2c3da3e1aa49de523ebf76a9dca6e06f38bdff4825857c9ca4fde07e1a

Contents?: true

Size: 510 Bytes

Versions: 3

Compression:

Stored size: 510 Bytes

Contents

module Syncano
  class API
    module Endpoints
      def self.definition(resources_definition)
        Module.new do
          resources_definition.each do |resource_definition|
            resource_class = ::Syncano::Resources.define_resource_class(resource_definition)

            define_method(resource_definition.name.tableize) do
              ::Syncano::QueryBuilder.new(connection, resource_class)
            end if resource_definition.top_level?
          end
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
syncano-4.0.0.alpha4 lib/syncano/api/endpoints.rb
syncano-4.0.0.alpha3 lib/syncano/api/endpoints.rb
syncano-4.0.0.alpha2 lib/syncano/api/endpoints.rb