Sha256: c077dcd9b60666ba8e3369dea03c9c82705847baa781f4bb158c0d627867bc94

Contents?: true

Size: 451 Bytes

Versions: 11

Compression:

Stored size: 451 Bytes

Contents

require_relative "location_label/filename"
require_relative "location_label/path"

module CutePrint
  # @api private
  class LocationLabel

    FORMATS = {
      filename: Filename,
      path: Path,
    }
    private_constant :FORMATS

    def self.make(format, location)
      klass = FORMATS[format]
      unless klass
        raise ArgumentError, "Unknown location format: #{format.inspect}"
      end
      klass.new(location)
    end

  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
cute_print-1.4.0 lib/cute_print/location_label.rb
cute_print-1.3.0 lib/cute_print/location_label.rb
cute_print-1.2.0 lib/cute_print/location_label.rb
cute_print-1.1.4 lib/cute_print/location_label.rb
cute_print-1.1.3 lib/cute_print/location_label.rb
cute_print-1.1.2 lib/cute_print/location_label.rb
cute_print-1.1.1 lib/cute_print/location_label.rb
cute_print-1.1.0 lib/cute_print/location_label.rb
cute_print-1.0.1 lib/cute_print/location_label.rb
cute_print-1.0.0 lib/cute_print/location_label.rb
cute_print-0.4.0 lib/cute_print/location_label.rb