tcrayford/Values — pull request #12 by benkirzhner (2013-06-09 23:22:20+00:00)
Title: Allow customization of Value classes using blocks

This change enables creation of value object classes that can be customized using a block, rather than subclassing. The benefit of this change can be seen in the code snippet below:
```ruby
require 'values'

class CreatedBySubclassing < Value.new(:a, :b)
# ...custom behavior...
end

CreatedByAssignment = Value.new(:a, :b) do
# ...custom behavior...
end

puts CreatedBySubclassing.ancestors.inspect
# prints: [CreatedBySubclassing, #, Object, Kernel, BasicObject]

puts CreatedByAssignment.ancestors.inspect
# prints: [CreatedByAssignment, Object, Kernel, BasicObject]
```
Note that customization by subclassing creates an anonymous class in the ancestor chain, which wastes memory and adds complexity to the class hierarchy with no apparent benefit.