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.



10
11
12
# File 'lib/db/model/statement/literal.rb', line 10

def initialize(value)
	@value = value
end

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



14
15
16
# File 'lib/db/model/statement/literal.rb', line 14

def value
  @value
end

Instance Method Details

#append_to(statement) ⇒ Object



16
17
18
# File 'lib/db/model/statement/literal.rb', line 16

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

#eql?(other) ⇒ Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/db/model/statement/literal.rb', line 20

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

#hashObject



24
25
26
# File 'lib/db/model/statement/literal.rb', line 24

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