Class: DB::Model::Statement::Literal

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value) ⇒ Literal

Returns a new instance of Literal.



27
28
29
# File 'lib/db/model/statement/literal.rb', line 27

def initialize(value)
	@value = value
end

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



31
32
33
# File 'lib/db/model/statement/literal.rb', line 31

def value
  @value
end

Instance Method Details

#append_to(statement) ⇒ Object



33
34
35
# File 'lib/db/model/statement/literal.rb', line 33

def append_to(statement)
	statement.literal(@value)
end

#eql?(other) ⇒ Boolean

Returns:

  • (Boolean)


37
38
39
# File 'lib/db/model/statement/literal.rb', line 37

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

#hashObject



41
42
43
# File 'lib/db/model/statement/literal.rb', line 41

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