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.
61 62 63 64 65 |
# File 'lib/db/model/statement/predicate.rb', line 61 def initialize(key, operator, value) @key = key @operator = operator @value = value end |
Instance Attribute Details
#key ⇒ Object (readonly)
Returns the value of attribute key.
67 68 69 |
# File 'lib/db/model/statement/predicate.rb', line 67 def key @key end |
#operator ⇒ Object (readonly)
Returns the value of attribute operator.
68 69 70 |
# File 'lib/db/model/statement/predicate.rb', line 68 def operator @operator end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
69 70 71 |
# File 'lib/db/model/statement/predicate.rb', line 69 def value @value end |
Instance Method Details
#append_to(statement) ⇒ Object
71 72 73 74 75 |
# File 'lib/db/model/statement/predicate.rb', line 71 def append_to(statement) @key.append_to(statement) statement.clause(@operator) @value.append_to(statement) end |
#eql?(other) ⇒ Boolean
77 78 79 |
# File 'lib/db/model/statement/predicate.rb', line 77 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
81 82 83 |
# File 'lib/db/model/statement/predicate.rb', line 81 def hash [self.class, @key, @operator, @value].hash end |