diff options
author | Takashi Kokubun <takashikkbn@gmail.com> | 2022-12-21 16:45:53 -0800 |
---|---|---|
committer | Takashi Kokubun <takashikkbn@gmail.com> | 2022-12-21 16:45:54 -0800 |
commit | 2537182063287271fa7240415d2e4c3fddb39ec2 (patch) | |
tree | 9793e74d7810b16e749f4aa8eaf848f5b8766ebb /NEWS.md | |
parent | 4e6b4cce8007a3a174cc2a715ffd21a56edfddd4 (diff) |
Make it clear that it doesn't update the receiver [ci skip]
Diffstat (limited to 'NEWS.md')
-rw-r--r-- | NEWS.md | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -180,9 +180,9 @@ Note: We're only listing outstanding class updates. Measure = Data.define(:amount, :unit) distance = Measure.new(100, 'km') #=> #<data Measure amount=100, unit="km"> weight = Measure.new(amount: 50, unit: 'kg') #=> #<data Measure amount=50, unit="kg"> + weight.with(amount: 40) #=> #<data Measure amount=40, unit="kg"> weight.amount #=> 50 weight.amount = 40 #=> NoMethodError: undefined method `amount=' - weight.with(amount: 40) #=> #<data Measure amount=40, unit="kg"> ``` * Encoding |