Class: U3d::UnityVersionNumber
- Inherits:
-
Object
- Object
- U3d::UnityVersionNumber
- Defined in:
- lib/u3d/unity_version_number.rb
Instance Attribute Summary collapse
-
#parts ⇒ Object
readonly
Returns the value of attribute parts.
-
#unity_version ⇒ Object
readonly
Returns the value of attribute unity_version.
Instance Method Summary collapse
-
#initialize(version) ⇒ UnityVersionNumber
constructor
A new instance of UnityVersionNumber.
- #to_s ⇒ Object
Constructor Details
#initialize(version) ⇒ UnityVersionNumber
Returns a new instance of UnityVersionNumber.
30 31 32 33 34 35 36 37 38 |
# File 'lib/u3d/unity_version_number.rb', line 30 def initialize(version) @unity_version = version parsed = Utils.parse_unity_version(@unity_version) parsed.each_with_index do |val, index| next if val.nil? || (index == 3) parsed[index] = val.to_i end @parts = parsed end |
Instance Attribute Details
#parts ⇒ Object (readonly)
Returns the value of attribute parts.
28 29 30 |
# File 'lib/u3d/unity_version_number.rb', line 28 def parts @parts end |
#unity_version ⇒ Object (readonly)
Returns the value of attribute unity_version.
27 28 29 |
# File 'lib/u3d/unity_version_number.rb', line 27 def unity_version @unity_version end |
Instance Method Details
#to_s ⇒ Object
40 41 42 |
# File 'lib/u3d/unity_version_number.rb', line 40 def to_s "#{parts[0]}.#{parts[1]}.#{parts[2]}#{parts[3]}#{parts[4]}" end |