Sha256: 1355915ee61215bf5de824818c1af52913cb5ee25404fb77eb4f211ab4b51ace

Contents?: true

Size: 922 Bytes

Versions: 1

Compression:

Stored size: 922 Bytes

Contents

# frozen_string_literal: true

module Attribool
  ##
  # Module that contains all gem version information. Follows semantic
  # versioning. Read: https://semver.org/
  module Version
    ##
    # Major version.
    #
    # @return [Integer]
    MAJOR = 1

    ##
    # Minor version.
    #
    # @return [Integer]
    MINOR = 0

    ##
    # Patch version.
    #
    # @return [Integer]
    PATCH = 3

    ##
    # Version as +[MAJOR, MINOR, PATCH]+
    #
    # @return [Array]
    def self.to_a
      [MAJOR, MINOR, PATCH]
    end

    ##
    # Version as +MAJOR.MINOR.PATCH+
    #
    # @return [String]
    def self.to_s
      to_a.join('.')
    end

    ##
    # Version as +{major: MAJOR, minor: MINOR, patch: PATCH}+
    #
    # @return [Hash]
    def self.to_h
      %i[major minor patch].zip(to_a).to_h
    end
  end

  ##
  # The version, as a string.
  #
  # @return [String]
  VERSION = Version.to_s.freeze
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
attribool-1.0.3 lib/attribool/version.rb