juanibiapina/virtribute — pull request #1 by ismaelga (2013-01-25 00:10:46+00:00)
Title: Added #virtual_attributes for defining multiple virtual attributes with same logic

Also added example in the readme and added spec for the new method and
for a read only attribute.

I think it could be better if we didn't need to use a variable for the real method name

Instead of

````ruby
virtual_attributes :price_a, :price_b do
real_attribute_name = "#{name}_int"
read { send(real_attribute_name).to_f / 100 }
write { |value| send("#{real_attribute_name}=", (value * 100).to_i) }
end
`````

doing something like

````ruby
virtual_attributes :price_a, :price_b, prefix: '_int' do
read { real_attr.to_f / 100 }
write { |value| real_attr = (value * 100).to_i }
end
`````

### But I'm not sure how to do it.