Class: PodBump::VersionModel

Inherits:
Object
  • Object
show all
Defined in:
lib/pod-bump/version_model.rb

Instance Method Summary collapse

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_majorObject



24
25
26
# File 'lib/pod-bump/version_model.rb', line 24

def increase_major
  @major += 1
end

#increase_minorObject



28
29
30
# File 'lib/pod-bump/version_model.rb', line 28

def increase_minor
  @minor += 1
end

#increase_patchObject



32
33
34
# File 'lib/pod-bump/version_model.rb', line 32

def increase_patch
  @patch += 1
end

#majorObject



12
13
14
# File 'lib/pod-bump/version_model.rb', line 12

def major
  return @major
end

#minorObject



16
17
18
# File 'lib/pod-bump/version_model.rb', line 16

def minor
  return @minor
end

#patchObject



20
21
22
# File 'lib/pod-bump/version_model.rb', line 20

def patch
  return @patch
end

#to_string_versionObject



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