Class: FReCon::Version

Inherits:
Object show all
Defined in:
lib/frecon/base/version.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(major:, minor:, patch:, prerelease: nil) ⇒ Version

Returns a new instance of Version.



16
17
18
# File 'lib/frecon/base/version.rb', line 16

def initialize(major:, minor:, patch:, prerelease: nil)
	@major, @minor, @patch, @prerelease = major, minor, patch, prerelease
end

Instance Attribute Details

#majorObject (readonly)

Returns the value of attribute major.



14
15
16
# File 'lib/frecon/base/version.rb', line 14

def major
  @major
end

#minorObject (readonly)

Returns the value of attribute minor.



14
15
16
# File 'lib/frecon/base/version.rb', line 14

def minor
  @minor
end

#patchObject (readonly)

Returns the value of attribute patch.



14
15
16
# File 'lib/frecon/base/version.rb', line 14

def patch
  @patch
end

#prereleaseObject (readonly)

Returns the value of attribute prerelease.



14
15
16
# File 'lib/frecon/base/version.rb', line 14

def prerelease
  @prerelease
end

Instance Method Details

#prerelease?Boolean

Returns:

  • (Boolean)


24
25
26
# File 'lib/frecon/base/version.rb', line 24

def prerelease?
	!!@prerelease
end

#release?Boolean

Returns:

  • (Boolean)


28
29
30
# File 'lib/frecon/base/version.rb', line 28

def release?
	!@prerelease
end

#to_sObject



20
21
22
# File 'lib/frecon/base/version.rb', line 20

def to_s
	format_string % [@major, @minor, @patch, @prerelease]
end