Class: VersionBoss::Gem::Version::PreReleaseIdentifier Private
- Inherits:
-
Object
- Object
- VersionBoss::Gem::Version::PreReleaseIdentifier
- Defined in:
- lib/version_boss/gem/version.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
A pre-release part of a version which consists of an optional prefix and an identifier
Instance Attribute Summary collapse
-
#identifier ⇒ String, Integer
readonly
private
The pre-release identifier.
-
#prefix ⇒ String
readonly
private
Gem versions can optionally prefix pre-release identifiers with a period.
Instance Method Summary collapse
-
#initialize(pre_release_part_str) ⇒ String
constructor
private
Create a new PreReleaseIdentifier keeping track of the optional prefix.
Constructor Details
#initialize(pre_release_part_str) ⇒ String
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Create a new PreReleaseIdentifier keeping track of the optional prefix
404 405 406 407 |
# File 'lib/version_boss/gem/version.rb', line 404 def initialize(pre_release_part_str) @prefix = pre_release_part_str.start_with?('.') ? '.' : '' @identifier = determine_part(pre_release_part_str) end |
Instance Attribute Details
#identifier ⇒ String, Integer (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
The pre-release identifier
The identifier is converted to an integer if it consists only of digits. Otherwise, it is left as a string.
388 389 390 |
# File 'lib/version_boss/gem/version.rb', line 388 def identifier @identifier end |
#prefix ⇒ String (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Gem versions can optionally prefix pre-release identifiers with a period
The prefix is not significant when sorting.
The prefix is saved so that the pre-release part can be reconstructed exactly as it was given.
375 376 377 |
# File 'lib/version_boss/gem/version.rb', line 375 def prefix @prefix end |