Class: MetaWhere::JoinType
- Inherits:
-
Object
- Object
- MetaWhere::JoinType
- Defined in:
- lib/meta_where/join_type.rb
Instance Attribute Summary collapse
-
#join_type ⇒ Object
readonly
Returns the value of attribute join_type.
-
#klass ⇒ Object
readonly
Returns the value of attribute klass.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #==(other) ⇒ Object (also: #eql?)
- #hash ⇒ Object
-
#initialize(name, join_type = Arel::Nodes::InnerJoin, klass = nil) ⇒ JoinType
constructor
A new instance of JoinType.
- #inner ⇒ Object
- #outer ⇒ Object
- #to_sym ⇒ Object
- #type(klass) ⇒ Object
Constructor Details
Instance Attribute Details
#join_type ⇒ Object (readonly)
Returns the value of attribute join_type.
3 4 5 |
# File 'lib/meta_where/join_type.rb', line 3 def join_type @join_type end |
#klass ⇒ Object (readonly)
Returns the value of attribute klass.
3 4 5 |
# File 'lib/meta_where/join_type.rb', line 3 def klass @klass end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/meta_where/join_type.rb', line 3 def name @name end |
Instance Method Details
#==(other) ⇒ Object Also known as: eql?
11 12 13 14 15 16 |
# File 'lib/meta_where/join_type.rb', line 11 def ==(other) self.class == other.class && name == other.name && join_type == other.join_type && klass == other.klass end |
#hash ⇒ Object
20 21 22 |
# File 'lib/meta_where/join_type.rb', line 20 def hash [name, join_type, klass].hash end |
#inner ⇒ Object
29 30 31 32 |
# File 'lib/meta_where/join_type.rb', line 29 def inner @join_type = Arel::Nodes::InnerJoin self end |
#outer ⇒ Object
24 25 26 27 |
# File 'lib/meta_where/join_type.rb', line 24 def outer @join_type = Arel::Nodes::OuterJoin self end |
#to_sym ⇒ Object
39 40 41 |
# File 'lib/meta_where/join_type.rb', line 39 def to_sym self end |
#type(klass) ⇒ Object
34 35 36 37 |
# File 'lib/meta_where/join_type.rb', line 34 def type(klass) @klass = klass self end |