Class: DB::Model::Statement::Predicate::Null

Inherits:
Object
  • Object
show all
Defined in:
lib/db/model/statement/predicate.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#keyObject (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

Returns:

  • (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

#hashObject



102
103
104
# File 'lib/db/model/statement/predicate.rb', line 102

def hash
	[self.class, @key].hash
end