Class: Fastlane::Wpmreleasetoolkit::Versioning::FourPartVersionFormatter
- Inherits:
-
AbstractVersionFormatter
- Object
- AbstractVersionFormatter
- Fastlane::Wpmreleasetoolkit::Versioning::FourPartVersionFormatter
- Defined in:
- lib/fastlane/plugin/wpmreleasetoolkit/versioning/formatters/four_part_version_formatter.rb
Overview
The ‘FourPartVersionFormatter` class extends the `VersionFormatter` class. It is a specialized version formatter for apps that use versions in the format of `1.2.3.4`.
Instance Method Summary collapse
-
#parse(version) ⇒ AppVersion
Parse the version string into an AppVersion instance.
-
#to_s(version) ⇒ String
Return the formatted version string.
Methods inherited from AbstractVersionFormatter
Instance Method Details
#parse(version) ⇒ AppVersion
Parse the version string into an AppVersion instance
17 18 19 20 21 22 23 |
# File 'lib/fastlane/plugin/wpmreleasetoolkit/versioning/formatters/four_part_version_formatter.rb', line 17 def parse(version) # Split the version string into its components components = version.split('.').map(&:to_i) # Create a new AppVersion instance from the version string components Fastlane::Models::AppVersion.new(*components) end |
#to_s(version) ⇒ String
Return the formatted version string
31 32 33 |
# File 'lib/fastlane/plugin/wpmreleasetoolkit/versioning/formatters/four_part_version_formatter.rb', line 31 def to_s(version) "#{version.major}.#{version.minor}.#{version.patch}.#{version.build_number}" end |