Class: JsTreeRails::Version
- Inherits:
-
Object
- Object
- JsTreeRails::Version
- Defined in:
- lib/jstree_rails/version.rb
Instance Attribute Summary collapse
-
#major ⇒ Object
readonly
Returns the value of attribute major.
-
#minor ⇒ Object
readonly
Returns the value of attribute minor.
-
#tiny ⇒ Object
readonly
Returns the value of attribute tiny.
Instance Method Summary collapse
-
#initialize(version) ⇒ Version
constructor
- version
-
Version number Creates a new Version instance.
- #to_s ⇒ Object
Constructor Details
#initialize(version) ⇒ Version
- version
-
Version number
Creates a new Version instance
7 8 9 10 |
# File 'lib/jstree_rails/version.rb', line 7 def initialize(version) version = version.split('.') @major, @minor, @tiny = [version[0].to_i, version[1].to_i, version[2].to_i] end |
Instance Attribute Details
#major ⇒ Object (readonly)
Returns the value of attribute major.
3 4 5 |
# File 'lib/jstree_rails/version.rb', line 3 def major @major end |
#minor ⇒ Object (readonly)
Returns the value of attribute minor.
3 4 5 |
# File 'lib/jstree_rails/version.rb', line 3 def minor @minor end |
#tiny ⇒ Object (readonly)
Returns the value of attribute tiny.
3 4 5 |
# File 'lib/jstree_rails/version.rb', line 3 def tiny @tiny end |
Instance Method Details
#to_s ⇒ Object
12 13 14 |
# File 'lib/jstree_rails/version.rb', line 12 def to_s "#{@major}.#{@minor}.#{@tiny}" end |