Class: Google::Protobuf::RepeatedField::ProxyingEnumerator
- Defined in:
- lib/google/protobuf/repeated_field.rb
Overview
propagates changes made by user of enumerator back to the original repeated field. This only applies in cases where the calling function which created the enumerator, such as #sort!, modifies itself rather than a new array, such as #sort
Instance Attribute Summary collapse
-
#external_enumerator ⇒ Object
Returns the value of attribute external_enumerator.
-
#repeated_field ⇒ Object
Returns the value of attribute repeated_field.
Instance Method Summary collapse
Instance Attribute Details
#external_enumerator ⇒ Object
Returns the value of attribute external_enumerator
159 160 161 |
# File 'lib/google/protobuf/repeated_field.rb', line 159 def external_enumerator @external_enumerator end |
#repeated_field ⇒ Object
Returns the value of attribute repeated_field
159 160 161 |
# File 'lib/google/protobuf/repeated_field.rb', line 159 def repeated_field @repeated_field end |
Instance Method Details
#each(*args, &block) ⇒ Object
160 161 162 163 164 165 166 167 168 169 170 171 |
# File 'lib/google/protobuf/repeated_field.rb', line 160 def each(*args, &block) results = [] external_enumerator.each_with_index do |val, i| result = yield(val) results << result #nil means no change occurred from yield; usually occurs when #to_a is called if result repeated_field[i] = result if result != val end end results end |