Method: BERT::Decode#read_tuple

Defined in:
lib/bert/decode.rb

#read_tuple(arity) ⇒ Object



163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
# File 'lib/bert/decode.rb', line 163

def read_tuple(arity)
  if arity > 0
    tag = read_any_raw
    if tag == :bert
      read_complex_type(arity)
    else
      tuple = Tuple.new(arity)
      tuple[0] = tag
      (arity - 1).times { |i| tuple[i + 1] = read_any_raw }
      tuple
    end
  else
    Tuple.new
  end
end