Class: FReCon::Version
Instance Attribute Summary collapse
-
#major ⇒ Object
readonly
Returns the value of attribute major.
-
#minor ⇒ Object
readonly
Returns the value of attribute minor.
-
#patch ⇒ Object
readonly
Returns the value of attribute patch.
-
#prerelease ⇒ Object
readonly
Returns the value of attribute prerelease.
Instance Method Summary collapse
-
#initialize(major:, minor:, patch:, prerelease: nil) ⇒ Version
constructor
A new instance of Version.
- #prerelease? ⇒ Boolean
- #release? ⇒ Boolean
- #to_s ⇒ Object
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
#major ⇒ Object (readonly)
Returns the value of attribute major.
14 15 16 |
# File 'lib/frecon/base/version.rb', line 14 def major @major end |
#minor ⇒ Object (readonly)
Returns the value of attribute minor.
14 15 16 |
# File 'lib/frecon/base/version.rb', line 14 def minor @minor end |
#patch ⇒ Object (readonly)
Returns the value of attribute patch.
14 15 16 |
# File 'lib/frecon/base/version.rb', line 14 def patch @patch end |
#prerelease ⇒ Object (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
24 25 26 |
# File 'lib/frecon/base/version.rb', line 24 def prerelease? !!@prerelease end |
#release? ⇒ Boolean
28 29 30 |
# File 'lib/frecon/base/version.rb', line 28 def release? !@prerelease end |
#to_s ⇒ Object
20 21 22 |
# File 'lib/frecon/base/version.rb', line 20 def to_s format_string % [@major, @minor, @patch, @prerelease] end |