Class: Inquery::Query::Chainable
- Inherits:
-
Inquery::Query
- Object
- Inquery::Query
- Inquery::Query::Chainable
- Includes:
- Mixins::RelationValidation
- Defined in:
- lib/inquery/query/chainable.rb
Constant Summary
Constants included from Mixins::RelationValidation
Mixins::RelationValidation::DEFAULT_OPTIONS, Mixins::RelationValidation::OPTIONS_SCHEMA
Instance Attribute Summary collapse
-
#relation ⇒ Object
readonly
Returns the value of attribute relation.
Attributes inherited from Inquery::Query
Class Method Summary collapse
-
.call(*args) ⇒ Object
Allows using this class as an AR scope.
Instance Method Summary collapse
- #call(*args) ⇒ Object
-
#initialize(*args) ⇒ Chainable
constructor
A new instance of Chainable.
Methods included from Mixins::RelationValidation
Methods inherited from Inquery::Query
#osparams, #process, #run, run
Constructor Details
#initialize(*args) ⇒ Chainable
Returns a new instance of Chainable.
16 17 18 19 20 |
# File 'lib/inquery/query/chainable.rb', line 16 def initialize(*args) relation, params = parse_init_args(*args) @relation = validate_relation!(relation) super(params) end |
Instance Attribute Details
#relation ⇒ Object (readonly)
Returns the value of attribute relation.
14 15 16 |
# File 'lib/inquery/query/chainable.rb', line 14 def relation @relation end |
Class Method Details
.call(*args) ⇒ Object
Allows using this class as an AR scope.
6 7 8 |
# File 'lib/inquery/query/chainable.rb', line 6 def self.call(*args) return new(*args).call end |
Instance Method Details
#call(*args) ⇒ Object
10 11 12 |
# File 'lib/inquery/query/chainable.rb', line 10 def call(*args) fail args.inspect end |