Class: Unitwise::Prefix

Inherits:
Base
  • Object
show all
Defined in:
lib/unitwise/prefix.rb

Overview

A prefix can be used with metric atoms to modify their scale.

Class Method Summary collapse

Methods inherited from Base

all, find, #names=, #slugs, #to_s

Class Method Details

.dataObject

The data loaded from the UCUM spec files



8
9
10
11
# File 'lib/unitwise/prefix.rb', line 8

def self.data
  f = File.open(data_file)
  @data ||= ::YAML.respond_to?(:unsafe_load) ? ::YAML.unsafe_load(f) : ::YAML.load(f)
end

.data_fileObject

The location of the UCUM spec prefix data file



15
16
17
# File 'lib/unitwise/prefix.rb', line 15

def self.data_file
  Unitwise.data_file 'prefix'
end