Class: Fastlane::Models::AppVersion
- Inherits:
-
Object
- Object
- Fastlane::Models::AppVersion
- Defined in:
- lib/fastlane/plugin/wpmreleasetoolkit/models/app_version.rb
Overview
The AppVersion model represents a version of an app with major, minor, patch, and build number components.
Instance Attribute Summary collapse
-
#build_number ⇒ Object
Returns the value of attribute build_number.
-
#major ⇒ Object
Returns the value of attribute major.
-
#minor ⇒ Object
Returns the value of attribute minor.
-
#patch ⇒ Object
Returns the value of attribute patch.
Instance Method Summary collapse
-
#initialize(major, minor, patch = 0, build_number = 0) ⇒ AppVersion
constructor
Initializes a new AppVersion instance.
-
#to_s ⇒ String
Converts the AppVersion object to a string representation.
Constructor Details
#initialize(major, minor, patch = 0, build_number = 0) ⇒ AppVersion
Initializes a new AppVersion instance.
14 15 16 17 18 19 20 21 22 23 |
# File 'lib/fastlane/plugin/wpmreleasetoolkit/models/app_version.rb', line 14 def initialize(major, minor, patch = 0, build_number = 0) # Validate that the major and minor version numbers are not nil UI.user_error!('Major version cannot be nil') if major.nil? UI.user_error!('Minor version cannot be nil') if minor.nil? @major = major @minor = minor @patch = patch @build_number = build_number end |
Instance Attribute Details
#build_number ⇒ Object
Returns the value of attribute build_number.
5 6 7 |
# File 'lib/fastlane/plugin/wpmreleasetoolkit/models/app_version.rb', line 5 def build_number @build_number end |
#major ⇒ Object
Returns the value of attribute major.
5 6 7 |
# File 'lib/fastlane/plugin/wpmreleasetoolkit/models/app_version.rb', line 5 def major @major end |
#minor ⇒ Object
Returns the value of attribute minor.
5 6 7 |
# File 'lib/fastlane/plugin/wpmreleasetoolkit/models/app_version.rb', line 5 def minor @minor end |
#patch ⇒ Object
Returns the value of attribute patch.
5 6 7 |
# File 'lib/fastlane/plugin/wpmreleasetoolkit/models/app_version.rb', line 5 def patch @patch end |
Instance Method Details
#to_s ⇒ String
Converts the AppVersion object to a string representation. This should only be used for internal debugging/testing purposes, not to write versions in version files In order to format an ‘AppVersion` into a `String`, you should use the appropriate `VersionFormatter` for your project instead.
31 32 33 |
# File 'lib/fastlane/plugin/wpmreleasetoolkit/models/app_version.rb', line 31 def to_s "#{@major}.#{@minor}.#{@patch}.#{@build_number}" end |