The more idomatic form of this is 
```ruby
def total
  books.reduce(0) { |sum, b| sum += b.price }
end
```

Another riff would be ```map(&:price).reduce(0, &:+)```

In the scenario you are dealing with a reference object (decimal and number are immutable here and also passed by value as you would expect), a common pattern for fetching/initializing, modifying/side effect and returning would be...

```ruby
def do_something
  get_thing.tap { |thing|
    thing.something = "dog"
    puts thing
  }
end
```

http://ruby-doc.org/core-2.1.0/Object.html#method-i-tap