Class: DB::Model::Statement::Literal
- Inherits:
-
Object
- Object
- DB::Model::Statement::Literal
- Defined in:
- lib/db/model/statement/literal.rb
Instance Attribute Summary collapse
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
- #append_to(statement) ⇒ Object
- #eql?(other) ⇒ Boolean
- #hash ⇒ Object
-
#initialize(value) ⇒ Literal
constructor
A new instance of Literal.
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
#value ⇒ Object (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
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 |
#hash ⇒ Object
24 25 26 |
# File 'lib/db/model/statement/literal.rb', line 24 def hash [self.class, @value].hash end |