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
-
#components ⇒ Array<Integer>
Returns an array of the version components.
-
#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.
16 17 18 19 20 21 22 23 24 25 |
# File 'lib/fastlane/plugin/wpmreleasetoolkit/models/app_version.rb', line 16 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.
7 8 9 |
# File 'lib/fastlane/plugin/wpmreleasetoolkit/models/app_version.rb', line 7 def build_number @build_number end |
#major ⇒ Object
Returns the value of attribute major.
7 8 9 |
# File 'lib/fastlane/plugin/wpmreleasetoolkit/models/app_version.rb', line 7 def major @major end |
#minor ⇒ Object
Returns the value of attribute minor.
7 8 9 |
# File 'lib/fastlane/plugin/wpmreleasetoolkit/models/app_version.rb', line 7 def minor @minor end |
#patch ⇒ Object
Returns the value of attribute patch.
7 8 9 |
# File 'lib/fastlane/plugin/wpmreleasetoolkit/models/app_version.rb', line 7 def patch @patch end |
Instance Method Details
#components ⇒ Array<Integer>
Returns an array of the version components.
41 42 43 |
# File 'lib/fastlane/plugin/wpmreleasetoolkit/models/app_version.rb', line 41 def components [@major, @minor, @patch, @build_number] end |
#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.
33 34 35 |
# File 'lib/fastlane/plugin/wpmreleasetoolkit/models/app_version.rb', line 33 def to_s "#{@major}.#{@minor}.#{@patch}.#{@build_number}" end |