Sha256: 1374f8773e5dc267859cfaf385fc131057eb0b88742d82e68662410a79a2449e

Contents?: true

Size: 146 Bytes

Versions: 4

Compression:

Stored size: 146 Bytes

Contents

require 'ruby-measurement/unit'

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

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ruby-measurement-1.2.3 lib/ruby-measurement/core_ext/symbol.rb
ruby-measurement-1.2.2 lib/ruby-measurement/core_ext/symbol.rb
ruby-measurement-1.2.1 lib/ruby-measurement/core_ext/symbol.rb
ruby-measurement-1.2.0 lib/ruby-measurement/core_ext/symbol.rb