Sha256: 00cb07e998c852c71338db8b784db3ee960abd4c8319e2b7ab1338eb7b78c320

Contents?: true

Size: 704 Bytes

Versions: 1

Compression:

Stored size: 704 Bytes

Contents

module Versionaire
  module Errors
    # Thrown when attempting to convert (cast) a primitive to a version.
    class Conversion < Base
      def self.string_message
        %(Invalid string conversion. Use: "<major>.<minor>.<maintenance>" or "v<major>.<minor>.<maintenance>".)
      end

      def self.array_message
        "Invalid array conversion. Use: [], [<major>], [<major>, <minor>], or [<major>, <minor>, <maintenance>]."
      end

      def self.hash_message
        "Invalid hash conversion. Use: {major: <major>, minor: <minor>, maintenance: <maintenance>}."
      end

      def self.primitive_message
        "Invalid conversion. Use: String, Array, or Hash."
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
versionaire-0.1.0 lib/versionaire/errors/conversion.rb