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.
31 32 33 34 35 36 37 38 39 40 |
# File 'lib/u3d/unity_version_number.rb', line 31 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.
29 30 31 |
# File 'lib/u3d/unity_version_number.rb', line 29 def parts @parts end |
#unity_version ⇒ Object (readonly)
Returns the value of attribute unity_version.
29 30 31 |
# File 'lib/u3d/unity_version_number.rb', line 29 def unity_version @unity_version end |
Instance Method Details
#to_s ⇒ Object
42 43 44 |
# File 'lib/u3d/unity_version_number.rb', line 42 def to_s "#{parts[0]}.#{parts[1]}.#{parts[2]}#{parts[3]}#{parts[4]}" end |