Method: Concurrent::MutableStruct#merge
- Defined in:
- lib/concurrent-ruby/concurrent/mutable_struct.rb
#merge(other) {|member, selfvalue, othervalue| ... } ⇒ Synchronization::AbstractStruct
Returns a new struct containing the contents of other and the contents of self. If no block is specified, the value for entries with duplicate keys will be that of other. Otherwise the value for each duplicate key is determined by calling the block with the key, its value in self and its value in other.
94 95 96 |
# File 'lib/concurrent-ruby/concurrent/mutable_struct.rb', line 94 def merge(other, &block) synchronize { ns_merge(other, &block) } end |