Class: Inquery::Query::Chainable

Inherits:
Inquery::Query show all
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

Attributes inherited from Inquery::Query

#params

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Mixins::RelationValidation

#validate_relation!

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

#relationObject (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