Class: Helper::Version
- Inherits:
-
Object
- Object
- Helper::Version
- Defined in:
- lib/Helper.rb
Instance Attribute Summary collapse
-
#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) ⇒ Version
constructor
A new instance of Version.
- #to_string ⇒ Object
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
#major ⇒ Object
Returns the value of attribute major.
15 16 17 |
# File 'lib/Helper.rb', line 15 def major @major end |
#minor ⇒ Object
Returns the value of attribute minor.
15 16 17 |
# File 'lib/Helper.rb', line 15 def minor @minor end |
#patch ⇒ Object
Returns the value of attribute patch.
15 16 17 |
# File 'lib/Helper.rb', line 15 def patch @patch end |
Instance Method Details
#to_string ⇒ Object
23 24 25 |
# File 'lib/Helper.rb', line 23 def to_string() "#{major.to_s}.#{minor.to_s}.#{patch.to_s}" end |