Sha256: 81cfa93f4b6ff05ce44c73eed67d11b448f597b8cf3e1d43d56839e14d532886

Contents?: true

Size: 686 Bytes

Versions: 4

Compression:

Stored size: 686 Bytes

Contents

module ROM
  module Yesql
    class Relation < ROM::Relation
      module ClassInterface
        # Set dataset name for the relation class
        #
        # The class will be extended with queries registered under that name.
        # By default dataset name is derived from the class name, which doesn't
        # have to match they key under which its queries were registered
        #
        # @return [Symbol]
        #
        # @api public
        def dataset(name = Undefined)
          return @dataset if name == Undefined
          @dataset = name
          define_query_methods(self, Relation.queries[name] || {})
          @dataset
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
rom-yesql-0.2.0 lib/rom/yesql/relation/class_interface.rb
rom-yesql-0.1.1 lib/rom/yesql/relation/class_interface.rb
rom-yesql-0.1.0 lib/rom/yesql/relation/class_interface.rb
rom-yesql-0.0.2 lib/rom/yesql/relation/class_interface.rb