In Files

Files

MathViz::Units::Class

Provides the new_units class method to all classes with units

Public Instance Methods

included(host) click to toggle source

extend MathViz::Units::Class

# File lib/mathviz.rb, line 209
def included(host)
  host.extend(MathViz::Units::Class)
end
new_units(*units) click to toggle source

Define new units (instance methods) on module MathViz::Units (where they will be picked up by everything including the module) Defined methods are essentialy aliases for unit(name); see MathViz::Measurable / MathViz::Measured

# File lib/mathviz.rb, line 200
def new_units(*units)
  units.each do |u|
    MathViz::Units.__send__ :define_method, u do
      unit(u)
    end
  end
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.