Class: Helper::Version

Inherits:
Object
  • Object
show all
Defined in:
lib/Helper.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(major, minor, patch) ⇒ Version

Returns a new instance of Version.



17
18
19
20
21
# File 'lib/Helper.rb', line 17

def initialize(major, minor, patch)
    @major = major.to_i
    @minor = minor.to_i
    @patch = patch.to_i
end

Instance Attribute Details

#majorObject

Returns the value of attribute major.



15
16
17
# File 'lib/Helper.rb', line 15

def major
  @major
end

#minorObject

Returns the value of attribute minor.



15
16
17
# File 'lib/Helper.rb', line 15

def minor
  @minor
end

#patchObject

Returns the value of attribute patch.



15
16
17
# File 'lib/Helper.rb', line 15

def patch
  @patch
end

Instance Method Details

#to_stringObject



23
24
25
# File 'lib/Helper.rb', line 23

def to_string()
    "#{major.to_s}.#{minor.to_s}.#{patch.to_s}"
end