Class: U3d::UnityModule
- Inherits:
-
Object
- Object
- U3d::UnityModule
- Defined in:
- lib/u3d/unity_module.rb
Instance Attribute Summary collapse
-
#checksum ⇒ Object
readonly
Validation attributes.
-
#command ⇒ Object
readonly
Internal attributes.
-
#depends_on ⇒ Object
readonly
Internal attributes.
-
#description ⇒ Object
readonly
Basic module attributes.
-
#destination ⇒ Object
readonly
Internal attributes.
-
#download_size ⇒ Object
readonly
Validation attributes.
-
#id ⇒ Object
readonly
Basic module attributes.
-
#installed_size ⇒ Object
readonly
Validation attributes.
-
#name ⇒ Object
readonly
Basic module attributes.
-
#os ⇒ Object
readonly
Internal attributes.
-
#rename_from ⇒ Object
readonly
Internal attributes.
-
#rename_to ⇒ Object
readonly
Internal attributes.
-
#url ⇒ Object
readonly
Basic module attributes.
Class Method Summary collapse
Instance Method Summary collapse
-
#depends_on?(other) ⇒ Boolean
rubocop:enable Metrics/ParameterLists.
-
#initialize(id:, name: nil, description: nil, url: nil, installed_size: nil, download_size: nil, checksum: nil, os: nil, depends_on: nil, command: nil, destination: nil, rename_from: nil, rename_to: nil) ⇒ UnityModule
constructor
rubocop:disable Metrics/ParameterLists.
Constructor Details
#initialize(id:, name: nil, description: nil, url: nil, installed_size: nil, download_size: nil, checksum: nil, os: nil, depends_on: nil, command: nil, destination: nil, rename_from: nil, rename_to: nil) ⇒ UnityModule
rubocop:disable Metrics/ParameterLists
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/u3d/unity_module.rb', line 35 def initialize( id:, name: nil, description: nil, url: nil, installed_size: nil, download_size: nil, checksum: nil, os: nil, depends_on: nil, command: nil, destination: nil, rename_from: nil, rename_to: nil ) @id = id.downcase @name = name @description = description @url = url @installed_size = installed_size @download_size = download_size @checksum = checksum @os = os @depends_on = depends_on @command = command @destination = destination @rename_from = rename_from @rename_to = rename_to end |
Instance Attribute Details
#checksum ⇒ Object (readonly)
Validation attributes
30 31 32 |
# File 'lib/u3d/unity_module.rb', line 30 def checksum @checksum end |
#command ⇒ Object (readonly)
Internal attributes
32 33 34 |
# File 'lib/u3d/unity_module.rb', line 32 def command @command end |
#depends_on ⇒ Object (readonly)
Internal attributes
32 33 34 |
# File 'lib/u3d/unity_module.rb', line 32 def depends_on @depends_on end |
#description ⇒ Object (readonly)
Basic module attributes
28 29 30 |
# File 'lib/u3d/unity_module.rb', line 28 def description @description end |
#destination ⇒ Object (readonly)
Internal attributes
32 33 34 |
# File 'lib/u3d/unity_module.rb', line 32 def destination @destination end |
#download_size ⇒ Object (readonly)
Validation attributes
30 31 32 |
# File 'lib/u3d/unity_module.rb', line 30 def download_size @download_size end |
#id ⇒ Object (readonly)
Basic module attributes
28 29 30 |
# File 'lib/u3d/unity_module.rb', line 28 def id @id end |
#installed_size ⇒ Object (readonly)
Validation attributes
30 31 32 |
# File 'lib/u3d/unity_module.rb', line 30 def installed_size @installed_size end |
#name ⇒ Object (readonly)
Basic module attributes
28 29 30 |
# File 'lib/u3d/unity_module.rb', line 28 def name @name end |
#os ⇒ Object (readonly)
Internal attributes
32 33 34 |
# File 'lib/u3d/unity_module.rb', line 32 def os @os end |
#rename_from ⇒ Object (readonly)
Internal attributes
32 33 34 |
# File 'lib/u3d/unity_module.rb', line 32 def rename_from @rename_from end |
#rename_to ⇒ Object (readonly)
Internal attributes
32 33 34 |
# File 'lib/u3d/unity_module.rb', line 32 def rename_to @rename_to end |
#url ⇒ Object (readonly)
Basic module attributes
28 29 30 |
# File 'lib/u3d/unity_module.rb', line 28 def url @url end |
Class Method Details
.load_modules(version, cached_versions, os: U3dCore::Helper.operating_system, offline: false) ⇒ Object
64 65 66 67 68 69 70 71 72 |
# File 'lib/u3d/unity_module.rb', line 64 def load_modules(version, cached_versions, os: U3dCore::Helper., offline: false) if version.is_a? Array UI.verbose "Loading modules for several versions: #{version}" load_versions_modules(version, cached_versions, os, offline) else UI.verbose "Loading modules for version #{version}" load_version_modules(version, cached_versions, os, offline) end end |
Instance Method Details
#depends_on?(other) ⇒ Boolean
rubocop:enable Metrics/ParameterLists
56 57 58 59 60 61 |
# File 'lib/u3d/unity_module.rb', line 56 def depends_on?(other) return true if other.id == 'unity' return false unless depends_on other.id == depends_on || other.name == depends_on end |