class Quantify::Unit::Prefix::Base
Attributes
factor[R]
name[R]
symbol[R]
Public Class Methods
configure(&block)
click to toggle source
# File lib/quantify/unit/prefix/base_prefix.rb, line 13 def self.configure(&block) self.class_eval(&block) if block end
load(options)
click to toggle source
# File lib/quantify/unit/prefix/base_prefix.rb, line 7 def self.load(options) if options.is_a? Hash Prefix.prefixes << self.new(options) end end
new(options)
click to toggle source
# File lib/quantify/unit/prefix/base_prefix.rb, line 19 def initialize(options) @symbol = options[:symbol].remove_underscores @factor = options[:factor].to_f @name = options[:name].remove_underscores.downcase end
Public Instance Methods
is_non_si_prefix?()
click to toggle source
# File lib/quantify/unit/prefix/base_prefix.rb, line 29 def is_non_si_prefix? self.is_a?(NonSI) end
is_si_prefix?()
click to toggle source
# File lib/quantify/unit/prefix/base_prefix.rb, line 25 def is_si_prefix? self.is_a? SI end
label()
click to toggle source
# File lib/quantify/unit/prefix/base_prefix.rb, line 33 def label symbol end