Sha256: a72eb00c3f65555b77c30afbf1a7082e67f3d69076d80a8b0d6317abe776e2ca
Contents?: true
Size: 552 Bytes
Versions: 11
Compression:
Stored size: 552 Bytes
Contents
module Unitwise::Standard class Function attr_accessor :attributes def initialize(attributes) @attributes = attributes end def name attributes["function"]["@name"] end def value attributes["function"]["@value"].to_f end def unit attributes["function"]["@Unit"] end def primary attributes["@Unit"].gsub(/\(.*\)/, '') end def secondary attributes["@UNIT"] end def to_hash {function_code: primary, value: value, unit_code: unit} end end end
Version data entries
11 entries across 11 versions & 1 rubygems