Sha256: aab5e8ab9da38dbe8e000cda99bfe9a66ab51946f3444fb2d7090a85760ead2c

Contents?: true

Size: 399 Bytes

Versions: 18

Compression:

Stored size: 399 Bytes

Contents

module Unitwise::Standard
  class Scale
    attr_accessor :nori

    def initialize(nori)
      @nori = nori
    end

    def value
      nori.attributes["value"].to_f
    end

    def primary_unit_code
      nori.attributes["Unit"]
    end

    def secondary_unit_code
      nori.attributes["UNIT"]
    end

    def to_hash
      {:value => value, :unit_code => primary_unit_code}
    end
  end
end

Version data entries

18 entries across 18 versions & 2 rubygems

Version Path
unitwise-2.1.0 lib/unitwise/standard/scale.rb
unitwise-2.0.0 lib/unitwise/standard/scale.rb
unitwise-1.1.0 lib/unitwise/standard/scale.rb
unitwise-193-1.0.4 lib/unitwise/standard/scale.rb
unitwise-1.0.4 lib/unitwise/standard/scale.rb
unitwise-1.0.3 lib/unitwise/standard/scale.rb
unitwise-1.0.2 lib/unitwise/standard/scale.rb
unitwise-1.0.1 lib/unitwise/standard/scale.rb
unitwise-1.0.0 lib/unitwise/standard/scale.rb
unitwise-0.10.0 lib/unitwise/standard/scale.rb
unitwise-0.9.1 lib/unitwise/standard/scale.rb
unitwise-0.9.0 lib/unitwise/standard/scale.rb
unitwise-0.8.1 lib/unitwise/standard/scale.rb
unitwise-0.8.0 lib/unitwise/standard/scale.rb
unitwise-0.7.1 lib/unitwise/standard/scale.rb
unitwise-0.7.0 lib/unitwise/standard/scale.rb
unitwise-0.6.2 lib/unitwise/standard/scale.rb
unitwise-0.6.1 lib/unitwise/standard/scale.rb