Permalink
Browse files

Remove #column_index helper; use #column_indices to check for int name

  • Loading branch information...
1 parent 6390951 commit e873392148103a013ec493b80faa697bb467e6cc @outoftime committed Jan 13, 2013
Showing with 2 additions and 6 deletions.
  1. +2 −6 lib/cassandra-cql/row.rb
@@ -22,12 +22,12 @@ def initialize(row, schema)
@row, @schema = row, schema
@value_cache = Hash.new { |h, key|
# If it's a number and not one of our columns, assume it's an index
- if key.kind_of?(Fixnum) and !column_names.include?(key)
+ if key.kind_of?(Fixnum) and !column_indices.key?(key)
column_name = column_names[key]
column_index = key
else
column_name = key
- column_index = column_index(key)
+ column_index = column_indices[key]
end
if column_index.nil?
@@ -53,10 +53,6 @@ def column_indices
@column_indices ||= Hash[column_names.each_with_index.to_a]
end
- def column_index(column_name)
- column_indices[column_name]
- end
-
def column_values
column_names.map do |name|
@value_cache[name]

0 comments on commit e873392

Please sign in to comment.