class UnitsDB::Prefix

Attributes

base[R]
id[R]
name[R]
power[R]
symbol[R]

Public Class Methods

new(id, hash) click to toggle source
# File lib/unitsdb_ruby/unitsdb.rb, line 93
def initialize(id, hash)
  @id = id
  @name = hash[:name]
  @base = hash[:base]
  @power = hash[:power]
  @symbol = hash[:symbol] # always is a hash
rescue StandardError
  raise StandardError.new "Parse fail on Prefix #{id}: #{hash}"
end

Public Instance Methods

ascii() click to toggle source
# File lib/unitsdb_ruby/unitsdb.rb, line 103
def ascii
  @symbol[:ascii]
end
html() click to toggle source
# File lib/unitsdb_ruby/unitsdb.rb, line 111
def html
  @symbol[:html]
end
latex() click to toggle source
# File lib/unitsdb_ruby/unitsdb.rb, line 119
def latex
  @symbol[:latex]
end
mathml() click to toggle source
# File lib/unitsdb_ruby/unitsdb.rb, line 115
def mathml
  @symbol[:html]
end
symbolid() click to toggle source
# File lib/unitsdb_ruby/unitsdb.rb, line 107
def symbolid
  @symbol[:ascii]
end
unicode() click to toggle source
# File lib/unitsdb_ruby/unitsdb.rb, line 123
def unicode
  @symbol[:unicode]
end