Module: PlainModel::Querying::Base
- Extended by:
- ActiveSupport::Concern
- Included in:
- PlainModel::QueryBuilder
- Defined in:
- lib/plain_model/querying/base.rb
Instance Method Summary collapse
- #_records ⇒ Object
- #dup ⇒ Object
- #dup_args ⇒ Object
- #initial_values ⇒ Object
- #initialize(*args) ⇒ Object
- #to_a ⇒ Object
Instance Method Details
#_records ⇒ Object
44 45 46 |
# File 'lib/plain_model/querying/base.rb', line 44 def _records raise NotImplementedError, "implement #_records private method in #{self.class}" end |
#dup ⇒ Object
34 35 36 37 38 |
# 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 ⇒ Object
40 41 42 |
# File 'lib/plain_model/querying/base.rb', line 40 def dup_args [] end |
#initial_values ⇒ Object
24 25 26 |
# File 'lib/plain_model/querying/base.rb', line 24 def initial_values {} end |
#initialize(*args) ⇒ Object
19 20 21 22 |
# File 'lib/plain_model/querying/base.rb', line 19 def initialize(*args) @values = initial_values super(*args) end |
#to_a ⇒ Object
28 29 30 31 32 |
# File 'lib/plain_model/querying/base.rb', line 28 def to_a return @to_a if defined?(@to_a) @to_a = _records end |