Sha256: 933acfe716ab2e764ca30d74a33edabac0c3e98906fb731a86c4aac3b15af8f0

Contents?: true

Size: 209 Bytes

Versions: 1

Compression:

Stored size: 209 Bytes

Contents

require 'ruby-measurement/measurement'

class String
  def to_measurement
    Measurement.parse(self)
  end

  def to_unit
    Measurement::Unit[self] or raise ArgumentError, "Invalid unit: #{self}"
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ruby-measurement-1.2.3 lib/ruby-measurement/core_ext/string.rb