Class: DB::Model::Statement::Predicate::Binary
- Inherits:
-
Object
- Object
- DB::Model::Statement::Predicate::Binary
- Defined in:
- lib/db/model/statement/predicate.rb
Instance Attribute Summary collapse
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#operator ⇒ Object
readonly
Returns the value of attribute operator.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
- #append_to(statement) ⇒ Object
- #eql?(other) ⇒ Boolean
- #hash ⇒ Object
-
#initialize(key, operator, value) ⇒ Binary
constructor
A new instance of Binary.
Constructor Details
#initialize(key, operator, value) ⇒ Binary
Returns a new instance of Binary.
78 79 80 81 82 |
# File 'lib/db/model/statement/predicate.rb', line 78 def initialize(key, operator, value) @key = key @operator = operator @value = value end |
Instance Attribute Details
#key ⇒ Object (readonly)
Returns the value of attribute key.
84 85 86 |
# File 'lib/db/model/statement/predicate.rb', line 84 def key @key end |
#operator ⇒ Object (readonly)
Returns the value of attribute operator.
85 86 87 |
# File 'lib/db/model/statement/predicate.rb', line 85 def operator @operator end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
86 87 88 |
# File 'lib/db/model/statement/predicate.rb', line 86 def value @value end |
Instance Method Details
#append_to(statement) ⇒ Object
88 89 90 91 92 |
# File 'lib/db/model/statement/predicate.rb', line 88 def append_to(statement) @key.append_to(statement) statement.clause(@operator) @value.append_to(statement) end |
#eql?(other) ⇒ Boolean
94 95 96 |
# File 'lib/db/model/statement/predicate.rb', line 94 def eql?(other) self.class.eql?(other.class) && self.key.eql?(other.key) && self.operator.eql?(other.operator) && self.value.eql?(other.value) end |
#hash ⇒ Object
98 99 100 |
# File 'lib/db/model/statement/predicate.rb', line 98 def hash [self.class, @key, @operator, @value].hash end |