Method: UnitMeasurements::Unit#initialize
- Defined in:
- lib/unit_measurements/unit.rb
#initialize(name, value:, aliases:, system:, unit_group: nil) ⇒ Unit
Initializes a new Unit
instance.
66 67 68 69 70 71 72 |
# File 'lib/unit_measurements/unit.rb', line 66 def initialize(name, value:, aliases:, system:, unit_group: nil) @name = name.to_s.freeze @value = value @aliases = Set.new(aliases.map(&:to_s).sort.map(&:freeze)).freeze @system = system.to_s.freeze @unit_group = unit_group end |