Module: Mool
- Defined in:
- lib/mool.rb,
lib/mool/version.rb
Constant Summary collapse
- BLOCK_SIZE =
512- BYTES =
"Bytes"- KBYTES =
"KBytes"- MBYTES =
"MBytes"- GBYTES =
"GBytes"- PARSE_TYPES =
{ BYTES => 1, KBYTES => 2**10, MBYTES => 2**20, GBYTES => 2**30 }
- VERSION =
"1.0.1"
Class Method Summary collapse
Class Method Details
.parse_to(obj, vars, parse) ⇒ Object
22 23 24 25 26 27 28 29 |
# File 'lib/mool.rb', line 22 def self.parse_to(obj, vars, parse) vars.each do |var| value = ((obj.instance_variable_get(var).to_f * PARSE_TYPES[obj.unity]) / PARSE_TYPES[parse]) obj.instance_variable_set(var, value) end obj.unity = parse obj end |