Class: PodBump::VersionModel
- Inherits:
-
Object
- Object
- PodBump::VersionModel
- Defined in:
- lib/pod-bump/version_model.rb
Instance Method Summary collapse
- #increase_major ⇒ Object
- #increase_minor ⇒ Object
- #increase_patch ⇒ Object
-
#initialize(version_string) ⇒ VersionModel
constructor
A new instance of VersionModel.
- #major ⇒ Object
- #minor ⇒ Object
- #patch ⇒ Object
- #to_string_version ⇒ Object
Constructor Details
#initialize(version_string) ⇒ VersionModel
Returns a new instance of VersionModel.
5 6 7 8 9 10 |
# File 'lib/pod-bump/version_model.rb', line 5 def initialize(version_string) versions = version_string.split(".") @major = versions[0].to_i @minor = versions[1].to_i @patch = versions[2].to_i end |
Instance Method Details
#increase_major ⇒ Object
24 25 26 |
# File 'lib/pod-bump/version_model.rb', line 24 def increase_major @major += 1 end |
#increase_minor ⇒ Object
28 29 30 |
# File 'lib/pod-bump/version_model.rb', line 28 def increase_minor @minor += 1 end |
#increase_patch ⇒ Object
32 33 34 |
# File 'lib/pod-bump/version_model.rb', line 32 def increase_patch @patch += 1 end |
#major ⇒ Object
12 13 14 |
# File 'lib/pod-bump/version_model.rb', line 12 def major return @major end |
#minor ⇒ Object
16 17 18 |
# File 'lib/pod-bump/version_model.rb', line 16 def minor return @minor end |
#patch ⇒ Object
20 21 22 |
# File 'lib/pod-bump/version_model.rb', line 20 def patch return @patch end |
#to_string_version ⇒ Object
36 37 38 |
# File 'lib/pod-bump/version_model.rb', line 36 def to_string_version @major.to_s + "." + @minor.to_s + "." + @patch.to_s end |