Class: DB::Model::Statement::Predicate::Null
- Inherits:
-
Object
- Object
- DB::Model::Statement::Predicate::Null
- Defined in:
- lib/db/model/statement/predicate.rb
Instance Attribute Summary collapse
-
#key ⇒ Object
readonly
Returns the value of attribute key.
Instance Method Summary collapse
- #append_to(statement) ⇒ Object
- #eql?(other) ⇒ Boolean
- #hash ⇒ Object
-
#initialize(key) ⇒ Null
constructor
A new instance of Null.
Constructor Details
#initialize(key) ⇒ Null
Returns a new instance of Null.
87 88 89 |
# File 'lib/db/model/statement/predicate.rb', line 87 def initialize(key) @key = key end |
Instance Attribute Details
#key ⇒ Object (readonly)
Returns the value of attribute key.
91 92 93 |
# File 'lib/db/model/statement/predicate.rb', line 91 def key @key end |
Instance Method Details
#append_to(statement) ⇒ Object
93 94 95 96 |
# File 'lib/db/model/statement/predicate.rb', line 93 def append_to(statement) @key.append_to(statement) statement.clause("IS NULL") end |
#eql?(other) ⇒ Boolean
98 99 100 |
# File 'lib/db/model/statement/predicate.rb', line 98 def eql?(other) self.class.eql?(other.class) && self.key.eql?(other.key) end |
#hash ⇒ Object
102 103 104 |
# File 'lib/db/model/statement/predicate.rb', line 102 def hash [self.class, @key].hash end |