Method: Units::UseBlocks.append_features

Defined in:
lib/units-system.rb

.append_features(target) ⇒ Object



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/units-system.rb', line 17

def self.append_features(target)
  def target.const_missing(name)
    begin
      name = name.to_sym
      if name==:Const
        Units::Const
      else
        result = @@constants[name] if @@constants
        result || Units.Measure(name)
      end
    rescue ArgumentError
      super
    end
  end
end