Module: Small::Units

Included in:
Integer
Defined in:
lib/small/units.rb

Instance Method Summary collapse

Instance Method Details

#unit(name, value) ⇒ Object



4
5
6
7
8
9
10
11
# File 'lib/small/units.rb', line 4

def unit(name, value)
  class_eval <<-METHOD
    def #{name}
      self * #{value.to_i}
    end
    alias :#{name}s :#{name}
  METHOD
end