Class: Virsandra::CQLValue
- Inherits:
-
Object
- Object
- Virsandra::CQLValue
- Defined in:
- lib/virsandra/cql_value.rb
Instance Attribute Summary collapse
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(value) ⇒ CQLValue
constructor
A new instance of CQLValue.
- #to_cql ⇒ Object
Constructor Details
#initialize(value) ⇒ CQLValue
Returns a new instance of CQLValue.
10 11 12 |
# File 'lib/virsandra/cql_value.rb', line 10 def initialize(value) @value = value end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
8 9 10 |
# File 'lib/virsandra/cql_value.rb', line 8 def value @value end |
Class Method Details
.convert(val) ⇒ Object
4 5 6 |
# File 'lib/virsandra/cql_value.rb', line 4 def self.convert(val) new(val).to_cql end |
Instance Method Details
#to_cql ⇒ Object
14 15 16 17 18 19 20 21 22 |
# File 'lib/virsandra/cql_value.rb', line 14 def to_cql if value.respond_to?(:to_guid) value.to_guid elsif should_escape?(value) "'#{escape(value)}'" else value.to_s end end |