Class: CassandraCQL::ResultSchema
- Inherits:
-
Object
- Object
- CassandraCQL::ResultSchema
- Defined in:
- lib/cassandra-cql/result.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#names ⇒ Object
readonly
Returns the value of attribute names.
-
#values ⇒ Object
readonly
Returns the value of attribute values.
Instance Method Summary collapse
-
#initialize(schema) ⇒ ResultSchema
constructor
A new instance of ResultSchema.
Constructor Details
#initialize(schema) ⇒ ResultSchema
Returns a new instance of ResultSchema.
26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/cassandra-cql/result.rb', line 26 def initialize(schema) # When https://issues.apache.org/jira/browse/CASSANDRA-3436 is resolve, no more need to split/last @names = Hash.new(schema.default_name_type.split(".").last) schema.name_types.each_pair { |key, type| @names[key] = type.split(".").last } @values = Hash.new(schema.default_value_type.split(".").last) schema.value_types.each_pair { |key, type| @values[key] = type.split(".").last } end |
Instance Attribute Details
#names ⇒ Object (readonly)
Returns the value of attribute names.
24 25 26 |
# File 'lib/cassandra-cql/result.rb', line 24 def names @names end |
#values ⇒ Object (readonly)
Returns the value of attribute values.
24 25 26 |
# File 'lib/cassandra-cql/result.rb', line 24 def values @values end |