Method: Origami::CompoundObject#update_values
- Defined in:
- lib/origami/compound.rb
#update_values(&b) ⇒ Object
Returns a new compound object with updated values based on the provided block.
127 128 129 130 131 132 133 |
# File 'lib/origami/compound.rb', line 127 def update_values(&b) return enum_for(__method__) unless block_given? return self.class.new self.transform_values(&b) if self.respond_to?(:transform_values) return self.class.new self.map(&b) if self.respond_to?(:map) raise NotImplementedError, "This object does not implement this method" end |