Class: CassandraCQL::ResultSchema

Inherits:
Object
  • Object
show all
Defined in:
lib/cassandra-cql/result.rb

Direct Known Subclasses

V08::ResultSchema

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#namesObject (readonly)

Returns the value of attribute names.



24
25
26
# File 'lib/cassandra-cql/result.rb', line 24

def names
  @names
end

#valuesObject (readonly)

Returns the value of attribute values.



24
25
26
# File 'lib/cassandra-cql/result.rb', line 24

def values
  @values
end