Class: CassandraCQL::V08::ResultSchema

Inherits:
ResultSchema show all
Defined in:
lib/cassandra-cql/0.8/result.rb

Instance Attribute Summary

Attributes inherited from ResultSchema

#names, #values

Instance Method Summary collapse

Constructor Details

#initialize(column_family) ⇒ ResultSchema

Returns a new instance of ResultSchema.



4
5
6
7
8
9
10
11
12
# File 'lib/cassandra-cql/0.8/result.rb', line 4

def initialize(column_family)
  type_slice = lambda {|type| type[type.rindex('.')+1..-1] }

  @names = Hash.new(type_slice.call(column_family.comparator_type))
  @values = Hash.new(type_slice.call(column_family.default_validation_class))
  column_family.columns.each_pair do |name, type|
    @values[name] = type_slice.call(type)
  end
end