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.



104
105
106
# File 'lib/db/model/statement/predicate.rb', line 104

def initialize(key)
	@key = key
end

Instance Attribute Details

#keyObject (readonly)

Returns the value of attribute key.



108
109
110
# File 'lib/db/model/statement/predicate.rb', line 108

def key
  @key
end

Instance Method Details

#append_to(statement) ⇒ Object



110
111
112
113
# File 'lib/db/model/statement/predicate.rb', line 110

def append_to(statement)
	@key.append_to(statement)
	statement.clause("IS NULL")
end

#eql?(other) ⇒ Boolean

Returns:

  • (Boolean)


115
116
117
# File 'lib/db/model/statement/predicate.rb', line 115

def eql?(other)
	self.class.eql?(other.class) && self.key.eql?(other.key)
end

#hashObject



119
120
121
# File 'lib/db/model/statement/predicate.rb', line 119

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