Parent

Methods

Files

Class/Module Index [+]

Quicksearch

Tarantool::TranslateToHash

note that :_tail should not be in field_names

Public Instance Methods

call(tuple) click to toggle source
# File lib/tarantool/response.rb, line 168
def call(tuple)
  i = 0
  hash = {}
  tuple_size = tuple.size
  names = field_names
  while i < tuple_size
    if name = names[i]
      hash[name] = tuple[i]
    else
      tail = tuple.slice(i..-1)
      hash[:_tail] = tail_size == 1 ? tail :
                     tail.each_slice(tail_size).to_a
      break
    end
    i += 1
  end
  hash
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.