https://github.com/solnic/virtus-units
ABANDONED - MOVE ON
https://github.com/solnic/virtus-units
Last synced: 3 months ago
JSON representation
ABANDONED - MOVE ON
- Host: GitHub
- URL: https://github.com/solnic/virtus-units
- Owner: solnic
- Created: 2011-07-08T11:46:38.000Z (almost 14 years ago)
- Default Branch: master
- Last Pushed: 2011-07-08T12:00:19.000Z (almost 14 years ago)
- Last Synced: 2024-12-31T09:29:16.315Z (5 months ago)
- Language: Ruby
- Homepage:
- Size: 93.8 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.markdown
Awesome Lists containing this project
README
# Virtus Units
This is a set of custom virtus attributes that use ruby-units to convert between
different units of measure.The project is currently only a code spike, a proof of concept. We'll
see how it goes.# API
It can look more or less like this:
class WaterPool
include Virtusattribute :capacity, Volume, :input_unit => :gallon, :output_unit => :liter
endwater_pool = WaterPool.new(:capacity => 10000)
water_pool.capacity # 37854.118