Class: Cassandra::Mocks::Statement::Token
- Inherits:
-
Struct
- Object
- Struct
- Cassandra::Mocks::Statement::Token
- Defined in:
- lib/cassandra_mocks/statement/token.rb
Instance Attribute Summary collapse
-
#type ⇒ Object
Returns the value of attribute type.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args) ⇒ Object
20 21 22 23 24 25 26 |
# File 'lib/cassandra_mocks/statement/token.rb', line 20 def method_missing(method, *args) if method_inquiry?(method) method[/[^\?]+/].to_sym == type else super end end |
Instance Attribute Details
#type ⇒ Object
Returns the value of attribute type
4 5 6 |
# File 'lib/cassandra_mocks/statement/token.rb', line 4 def type @type end |
#value ⇒ Object
Returns the value of attribute value
4 5 6 |
# File 'lib/cassandra_mocks/statement/token.rb', line 4 def value @value end |
Instance Method Details
#normalized_value ⇒ Object
5 6 7 8 9 10 11 12 13 14 |
# File 'lib/cassandra_mocks/statement/token.rb', line 5 def normalized_value case type when :int value.to_i when :float value.to_f else value end end |
#respond_to?(method) ⇒ Boolean
16 17 18 |
# File 'lib/cassandra_mocks/statement/token.rb', line 16 def respond_to?(method) method_inquiry?(method) || super end |