Class: Squeel::Nodes::Join
- Inherits:
-
Object
- Object
- Squeel::Nodes::Join
- Defined in:
- lib/squeel/nodes/join.rb
Instance Attribute Summary collapse
-
#klass ⇒ Object
Returns the value of attribute klass.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
- #eql?(other) ⇒ Boolean (also: #==)
-
#initialize(name, type = Arel::InnerJoin, klass = nil) ⇒ Join
constructor
A new instance of Join.
- #inner ⇒ Object
- #method_missing(method_id, *args) ⇒ Object
- #outer ⇒ Object
- #polymorphic? ⇒ Boolean
-
#to_sym ⇒ Object
expand_hash_conditions_for_aggregates assumes our hash keys can be converted to symbols, so this has to be implemented, but it doesn’t really have to do anything useful.
Constructor Details
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method_id, *args) ⇒ Object
38 39 40 41 42 43 44 45 |
# File 'lib/squeel/nodes/join.rb', line 38 def method_missing(method_id, *args) super if method_id == :to_ary if (args.size == 1) && (Class === args[0]) KeyPath.new(self, Join.new(method_id, Arel::InnerJoin, args[0])) else KeyPath.new(self, method_id) end end |
Instance Attribute Details
#klass ⇒ Object
Returns the value of attribute klass.
4 5 6 |
# File 'lib/squeel/nodes/join.rb', line 4 def klass @klass end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
4 5 6 |
# File 'lib/squeel/nodes/join.rb', line 4 def name @name end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
4 5 6 |
# File 'lib/squeel/nodes/join.rb', line 4 def type @type end |
Instance Method Details
#eql?(other) ⇒ Boolean Also known as: ==
29 30 31 32 33 34 |
# File 'lib/squeel/nodes/join.rb', line 29 def eql?(other) self.class == other.class && self.name == other.name && self.type == other.type && self.klass == other.klass end |
#inner ⇒ Object
11 12 13 14 |
# File 'lib/squeel/nodes/join.rb', line 11 def inner @type = Arel::InnerJoin self end |
#outer ⇒ Object
16 17 18 19 |
# File 'lib/squeel/nodes/join.rb', line 16 def outer @type = Arel::OuterJoin self end |
#polymorphic? ⇒ Boolean
25 26 27 |
# File 'lib/squeel/nodes/join.rb', line 25 def polymorphic? @klass end |
#to_sym ⇒ Object
expand_hash_conditions_for_aggregates assumes our hash keys can be converted to symbols, so this has to be implemented, but it doesn’t really have to do anything useful.
50 51 52 |
# File 'lib/squeel/nodes/join.rb', line 50 def to_sym nil end |