module PlainModel::Querying::Base

Public Class Methods

new(*args) click to toggle source
Calls superclass method
# File lib/plain_model/querying/base.rb, line 19
def initialize(*args)
  @values = initial_values
  super(*args)
end

Public Instance Methods

_records() click to toggle source
# File lib/plain_model/querying/base.rb, line 44
def _records
  raise NotImplementedError, "implement #_records private method in #{self.class}"
end
dup() click to toggle source
# File lib/plain_model/querying/base.rb, line 34
def dup
  new_instance = self.class.new(*dup_args)
  new_instance.values = values.dup
  new_instance
end
dup_args() click to toggle source
# File lib/plain_model/querying/base.rb, line 40
def dup_args
  []
end
initial_values() click to toggle source
# File lib/plain_model/querying/base.rb, line 24
def initial_values
  {}
end
to_a() click to toggle source
# File lib/plain_model/querying/base.rb, line 28
def to_a
  return @to_a if defined?(@to_a)

  @to_a = _records
end