Sha256: a43fe2918411806f1b93daab25baf178479a752c7fca49329ec7cfc3f839b335

Contents?: true

Size: 575 Bytes

Versions: 16

Compression:

Stored size: 575 Bytes

Contents

module Unitwise
  # A prefix can be used with metric atoms to modify their scale.
  class Prefix < Base
    liner :scalar

    # The data loaded from the UCUM spec files
    # @api semipublic
    def self.data
      @data ||= YAML.load File.open(data_file)
    end

    # The location of the UCUM spec prefix data file
    # @api semipublic
    def self.data_file
      Unitwise.data_file 'prefix'
    end

    # Set the scalar value for the prefix, always as a BigDecimal
    # @api semipublic
    def scalar=(value)
      @scalar = BigDecimal(value.to_s)
    end
  end
end

Version data entries

16 entries across 16 versions & 2 rubygems

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