Sha256: 544b0985157fd0cc94493c6f98d3e61969fcbd780b6d8f290f2e728ca6973e2b
Contents?: true
Size: 328 Bytes
Versions: 24
Compression:
Stored size: 328 Bytes
Contents
require 'active_support/inflector/methods' class Numeric Weighable::Weight::UNIT.each do |unit, _| unit = unit.to_s plural_unit = ActiveSupport::Inflector.pluralize(unit) define_method unit do Weighable::Weight.new(self, unit) end alias_method plural_unit, unit unless plural_unit == unit end end
Version data entries
24 entries across 24 versions & 1 rubygems