Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def get(column_family, key, super_column = nil, column = nil)
- column_family += ":#{super_column}" if super_column
- column_family += ":#{column}" if column
- # You have got to be kidding
- args = [@table, key, column_family]
- get_column = if is_super(column_family)
- column ? :get_column : :get_superColumn
- else
- super_column ? :get_column : (args << @block_for; :get_columns_since)
- end
- response = @client.send(get_column, *args)
- case response
- when Column_t: response.value
- when SuperColumn_t: columns_to_hash(response.columns)
- when Array: columns_to_hash(response)
- end
- rescue NotFoundException
- is_super(column_family) && !column ? {} : nil
- end
Add Comment
Please, Sign In to add comment