Class: Polyamorous::Join
- Inherits:
-
Object
- Object
- Polyamorous::Join
- Defined in:
- lib/polyamorous/join.rb
Instance Attribute Summary collapse
-
#klass ⇒ Object
Returns the value of attribute klass.
-
#name ⇒ Object
Returns the value of attribute name.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
- #eql?(other) ⇒ Boolean (also: #==)
- #hash ⇒ Object
-
#initialize(name, type = Arel::InnerJoin, klass = nil) ⇒ Join
constructor
A new instance of Join.
Constructor Details
#initialize(name, type = Arel::InnerJoin, klass = nil) ⇒ Join
6 7 8 9 10 |
# File 'lib/polyamorous/join.rb', line 6 def initialize(name, type = Arel::InnerJoin, klass = nil) @name = name @type = convert_to_arel_join_type(type) @klass = convert_to_class(klass) if klass end |
Instance Attribute Details
#klass ⇒ Object
Returns the value of attribute klass.
4 5 6 |
# File 'lib/polyamorous/join.rb', line 4 def klass @klass end |
#name ⇒ Object
Returns the value of attribute name.
3 4 5 |
# File 'lib/polyamorous/join.rb', line 3 def name @name end |
#type ⇒ Object
Returns the value of attribute type.
4 5 6 |
# File 'lib/polyamorous/join.rb', line 4 def type @type end |
Instance Method Details
#eql?(other) ⇒ Boolean Also known as: ==
24 25 26 27 28 29 |
# File 'lib/polyamorous/join.rb', line 24 def eql?(other) self.class == other.class && self.name == other.name && self.type == other.type && self.klass == other.klass end |
#hash ⇒ Object
20 21 22 |
# File 'lib/polyamorous/join.rb', line 20 def hash [@name, @type, @klass].hash end |