Sha256: 3648dc92abe4ad0440b64f8f799a165e77c8e2b0000171659ab0cf579cc5010e
Contents?: true
Size: 1.11 KB
Versions: 22
Compression:
Stored size: 1.11 KB
Contents
# -*- encoding: utf-8 -*- # -*- frozen_string_literal: true -*- # -*- warn_indent: true -*- module UnitMeasurements # The +UnitMeasurements::UnitAlreadyDefinedError+ class is used to indicate # that an attempt was made to define a unit that has already been defined # within a unit group. # # The error message states that the unit is already defined and provides the # name of the conflicting unit. # # @see BaseError # @author {Harshal V. Ladhe}[https://shivam091.github.io/] # @since 1.0.0 class UnitAlreadyDefinedError < BaseError # The name of the unit that is already defined. # # @return [String] The name of the unit that is already defined. # # @author {Harshal V. Ladhe}[https://shivam091.github.io/] # @since 1.0.0 attr_reader :unit # Initializes a new +UnitAlreadyDefinedError+ instance. # # @param [String] unit The name of the unit that is already defined. # # @author {Harshal V. Ladhe}[https://shivam091.github.io/] # @since 1.0.0 def initialize(unit) @unit = unit super("Unit already defined: '#{unit}'.") end end end
Version data entries
22 entries across 22 versions & 2 rubygems