Module: Quo::ComposedQuery::ClassMethods
- Defined in:
- lib/quo/composed_query.rb,
sig/generated/quo/composed_query.rbs
Overview
Class-level methods shared by every composed query class. Defined once
here and extended onto each anon class via the included hook below
rather than being re-defined on every Class.new in the composer.
Instance Attribute Summary collapse
-
#_composing_joins ⇒ Object
readonly
Returns the value of attribute _composing_joins.
-
#_left_query ⇒ Object
readonly
Returns the value of attribute _left_query.
-
#_left_specification ⇒ Object
readonly
Returns the value of attribute _left_specification.
-
#_right_query ⇒ Object
readonly
Returns the value of attribute _right_query.
-
#_right_specification ⇒ Object
readonly
Returns the value of attribute _right_specification.
Instance Method Summary collapse
Instance Attribute Details
#_composing_joins ⇒ Object (readonly)
Returns the value of attribute _composing_joins.
14 15 16 |
# File 'lib/quo/composed_query.rb', line 14 def _composing_joins @_composing_joins end |
#_left_query ⇒ Object (readonly)
Returns the value of attribute _left_query.
14 15 16 |
# File 'lib/quo/composed_query.rb', line 14 def _left_query @_left_query end |
#_left_specification ⇒ Object (readonly)
Returns the value of attribute _left_specification.
14 15 16 |
# File 'lib/quo/composed_query.rb', line 14 def _left_specification @_left_specification end |
#_right_query ⇒ Object (readonly)
Returns the value of attribute _right_query.
14 15 16 |
# File 'lib/quo/composed_query.rb', line 14 def _right_query @_right_query end |
#_right_specification ⇒ Object (readonly)
Returns the value of attribute _right_specification.
14 15 16 |
# File 'lib/quo/composed_query.rb', line 14 def _right_specification @_right_specification end |
Instance Method Details
#inspect ⇒ String
17 18 19 20 21 22 23 24 25 26 |
# File 'lib/quo/composed_query.rb', line 17 def inspect left_desc = quo_operand_desc(_left_query) right_desc = quo_operand_desc(_right_query) klass_name = if self < Quo::RelationBackedQuery Quo.relation_backed_query_base_class.name else Quo.collection_backed_query_base_class.name end "#{klass_name}<Quo::ComposedQuery>[#{left_desc}, #{right_desc}]" end |
#quo_operand_desc(operand) ⇒ String
30 31 32 33 34 35 36 |
# File 'lib/quo/composed_query.rb', line 30 def quo_operand_desc(operand) if operand < Quo::ComposedQuery operand.inspect else operand.name || operand.superclass&.name || "(anonymous)" end end |