Module: Attribool::Version

Defined in:
lib/attribool/version.rb

Overview

Module that contains all gem version information. Follows semantic versioning. Read: semver.org/

Constant Summary collapse

MAJOR =

Major version.

Returns:

  • (Integer)
2
MINOR =

Minor version.

Returns:

  • (Integer)
0
PATCH =

Patch version.

Returns:

  • (Integer)
5

Class Method Summary collapse

Class Method Details

.to_aArray<Integer>

Version as [MAJOR, MINOR, PATCH]

Returns:

  • (Array<Integer>)


32
33
34
# File 'lib/attribool/version.rb', line 32

def to_a
  [MAJOR, MINOR, PATCH]
end

.to_hHash

Version as {major: MAJOR, minor: MINOR, patch: PATCH}

Returns:

  • (Hash)


48
49
50
# File 'lib/attribool/version.rb', line 48

def to_h
  %i[major minor patch].zip(to_a).to_h
end

.to_sString

Version as MAJOR.MINOR.PATCH

Returns:

  • (String)


40
41
42
# File 'lib/attribool/version.rb', line 40

def to_s
  to_a.join(".")
end