Method: Concurrent::Tuple#get

Defined in:
lib/concurrent-ruby/concurrent/tuple.rb

#get(i) ⇒ Object Also known as: volatile_get

Get the value of the element at the given index.

Parameters:

  • i (Integer)

    the index from which to retrieve the value

Returns:

  • (Object)

    the value at the given index or nil if the index is out of bounds



43
44
45
46
# File 'lib/concurrent-ruby/concurrent/tuple.rb', line 43

def get(i)
  return nil if i >= @size || i < 0
  @tuple[i].get
end