Class: Lapis::Minecraft::Version
- Inherits:
-
Lapis::Minecraft::Versioning::Basic
- Object
- Lapis::Minecraft::Versioning::Basic
- Lapis::Minecraft::Version
- Defined in:
- lib/lapis/minecraft/version.rb
Overview
This class uses lazy-loading to retrieve additional information only when it is needed.
Complete information about a Minecraft version.
Instance Attribute Summary
Attributes inherited from Lapis::Minecraft::Versioning::Basic
Instance Method Summary collapse
-
#==(other) ⇒ true, false
Compares one version to another.
-
#asset_index ⇒ Versioning::AssetIndex
Overview of assets included in this version.
-
#assets ⇒ Array<Versioning::Asset>
List of assets needed for this version.
-
#client_download ⇒ Versioning::Resource?
Retrieves the client jar information for this version.
-
#downloads ⇒ Array<Versioning::Resource>
List of downloads available for this version.
-
#initialize(basic_info, meta_server) ⇒ Version
constructor
Creates version information.
-
#launcher_properties ⇒ Versioning::LauncherProperties
Information about how to start the client in a launcher.
-
#libraries ⇒ Array<Versioning::Library>
List of libraries needed to run this version.
-
#server_download ⇒ Versioning::Resource?
Retrieves the server jar information for this version.
Constructor Details
#initialize(basic_info, meta_server) ⇒ Version
Creates version information.
13 14 15 16 |
# File 'lib/lapis/minecraft/version.rb', line 13 def initialize(basic_info, ) super(basic_info.id, basic_info.type, basic_info.time, basic_info.url) = end |
Instance Method Details
#==(other) ⇒ true, false
Compares one version to another.
66 67 68 69 70 71 72 73 74 75 76 |
# File 'lib/lapis/minecraft/version.rb', line 66 def ==(other) # Ordered by least expensive to most expensive. super(other) && other.asset_index == asset_index && other.launcher_properties == launcher_properties && other.client_download == client_download && other.server_download == server_download && other.downloads == downloads && other.libraries == libraries && other.assets == assets end |
#asset_index ⇒ Versioning::AssetIndex
Overview of assets included in this version.
26 27 28 |
# File 'lib/lapis/minecraft/version.rb', line 26 def asset_index details.asset_index end |
#assets ⇒ Array<Versioning::Asset>
List of assets needed for this version.
20 21 22 |
# File 'lib/lapis/minecraft/version.rb', line 20 def assets @assets ||= .get_assets(asset_index.url) end |
#client_download ⇒ Versioning::Resource?
Retrieves the client jar information for this version.
39 40 41 |
# File 'lib/lapis/minecraft/version.rb', line 39 def client_download details.client_download end |
#downloads ⇒ Array<Versioning::Resource>
List of downloads available for this version.
32 33 34 |
# File 'lib/lapis/minecraft/version.rb', line 32 def downloads details.downloads end |
#launcher_properties ⇒ Versioning::LauncherProperties
Information about how to start the client in a launcher.
58 59 60 |
# File 'lib/lapis/minecraft/version.rb', line 58 def launcher_properties details.launcher_properties end |
#libraries ⇒ Array<Versioning::Library>
List of libraries needed to run this version.
52 53 54 |
# File 'lib/lapis/minecraft/version.rb', line 52 def libraries details.libraries end |
#server_download ⇒ Versioning::Resource?
Retrieves the server jar information for this version.
46 47 48 |
# File 'lib/lapis/minecraft/version.rb', line 46 def server_download details.server_download end |