Guest User

Untitled

a guest
Jun 22nd, 2018
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. def get(column_family, key, super_column = nil, column = nil)
  2. column_family += ":#{super_column}" if super_column
  3. column_family += ":#{column}" if column
  4.  
  5. # You have got to be kidding
  6. args = [@table, key, column_family]
  7. get_column = if is_super(column_family)
  8. column ? :get_column : :get_superColumn
  9. else
  10. super_column ? :get_column : (args << @block_for; :get_columns_since)
  11. end
  12. response = @client.send(get_column, *args)
  13.  
  14. case response
  15. when Column_t: response.value
  16. when SuperColumn_t: columns_to_hash(response.columns)
  17. when Array: columns_to_hash(response)
  18. end
  19. rescue NotFoundException
  20. is_super(column_family) && !column ? {} : nil
  21. end
Add Comment
Please, Sign In to add comment