class Sequel::Model::DatasetModule

  1. lib/sequel/model/dataset_module.rb
Parent: Model

This Module subclass is used by Model.dataset_module to add dataset methods to classes. It adds a couple of features standard Modules, allowing you to use the same subset method you can call on Model, as well as making sure that public methods added to the module automatically have class methods created for them.

Methods

Public Class

  1. new

Public Instance

  1. subset

Public Class methods

new (model)

Store the model related to this dataset module.

[show source]
# File lib/sequel/model/dataset_module.rb, line 11
def initialize(model)
  @model = model
end

Public Instance methods

subset (name, *args, &block)

Define a named filter for this dataset, see Model.subset for details.

[show source]
# File lib/sequel/model/dataset_module.rb, line 17
def subset(name, *args, &block)
  define_method(name){filter(*args, &block)}
end