Module: Google

Defined in:
lib/google/protobuf.rb,
lib/google/protobuf.rb,
lib/google/protobuf/any_pb.rb,
lib/google/protobuf/api_pb.rb,
lib/google/protobuf/type_pb.rb,
lib/google/protobuf/empty_pb.rb,
lib/google/protobuf/struct_pb.rb,
lib/google/protobuf/duration_pb.rb,
lib/google/protobuf/wrappers_pb.rb,
lib/google/protobuf/message_exts.rb,
lib/google/protobuf/timestamp_pb.rb,
lib/google/protobuf/field_mask_pb.rb,
lib/google/protobuf/repeated_field.rb,
lib/google/protobuf/well_known_types.rb,
lib/google/protobuf/source_context_pb.rb,
ext/google/protobuf_c/protobuf.c

Overview

This class makes RepeatedField act (almost-) like a Ruby Array. It has convenience methods that extend the core C or Java based methods.

This is a best-effort to mirror Array behavior. Two comments:

1) patches always welcome :)
2) if performance is an issue, feel free to rewrite the method
   in jruby and C.  The source code has plenty of examples

KNOWN ISSUES

- #[]= doesn't allow less used approaches such as `arr[1, 2] = 'fizz'`
- #concat should return the orig array
- #push should accept multiple arguments and push them all at the same time

Defined Under Namespace

Modules: Protobuf