Module: Mailgun::Tracking::Version

Defined in:
lib/mailgun/tracking/version.rb

Overview

The module which hold version data.

Constant Summary collapse

KEYS =
%i[major minor patch].freeze
DOT =
'.'

Class Method Summary collapse

Class Method Details

.majorInteger

Major version.

Returns:

  • (Integer)


15
16
17
# File 'lib/mailgun/tracking/version.rb', line 15

def major
  3
end

.minorInteger

Minor version.

Returns:

  • (Integer)


22
23
24
# File 'lib/mailgun/tracking/version.rb', line 22

def minor
  0
end

.patchInteger

Patch version.

Returns:

  • (Integer)


29
30
31
# File 'lib/mailgun/tracking/version.rb', line 29

def patch
  0
end

.to_aArray

Return an array representation of version.

Returns:

  • (Array)


43
44
45
# File 'lib/mailgun/tracking/version.rb', line 43

def to_a
  [major, minor, patch]
end

.to_hHash

Return a hash representation of version.

Returns:

  • (Hash)


36
37
38
# File 'lib/mailgun/tracking/version.rb', line 36

def to_h
  ::Hash[KEYS.zip(to_a)]
end

.to_sString

Return a string representation of version.

Returns:

  • (String)


50
51
52
# File 'lib/mailgun/tracking/version.rb', line 50

def to_s
  to_a.join(DOT)
end