Class: Lapis::Minecraft::Versioning::AssetIndex
- Inherits:
-
Object
- Object
- Lapis::Minecraft::Versioning::AssetIndex
- Defined in:
- lib/lapis/minecraft/versioning/asset_index.rb
Overview
Note:
This class isn’t used directly for accessing asset instances. It is used for retrieving information about assets.
Container for tracking information about assets.
Instance Attribute Summary collapse
-
#id ⇒ String
readonly
Unique name of the collection of assets.
-
#sha1 ⇒ String
readonly
SHA1 hash of the asset list document in hexadecimal.
-
#size ⇒ Fixnum
readonly
Size of the asset list document in bytes.
-
#total_size ⇒ Fixnum
readonly
Total size of all the assets combined.
-
#url ⇒ String
readonly
Location of where the asset list document can be found.
Instance Method Summary collapse
-
#==(other) ⇒ true, false
Compares one asset index to another.
-
#initialize(id, sha1, size, url, total_size) ⇒ AssetIndex
constructor
Creates an asset index.
Constructor Details
#initialize(id, sha1, size, url, total_size) ⇒ AssetIndex
Creates an asset index.
37 38 39 40 41 42 43 |
# File 'lib/lapis/minecraft/versioning/asset_index.rb', line 37 def initialize(id, sha1, size, url, total_size) @id = id.dup.freeze @sha1 = sha1.dup.freeze @size = size @url = url.dup.freeze @total_size = total_size end |
Instance Attribute Details
#id ⇒ String (readonly)
Unique name of the collection of assets.
13 14 15 |
# File 'lib/lapis/minecraft/versioning/asset_index.rb', line 13 def id @id end |
#sha1 ⇒ String (readonly)
SHA1 hash of the asset list document in hexadecimal.
17 18 19 |
# File 'lib/lapis/minecraft/versioning/asset_index.rb', line 17 def sha1 @sha1 end |
#size ⇒ Fixnum (readonly)
Size of the asset list document in bytes.
21 22 23 |
# File 'lib/lapis/minecraft/versioning/asset_index.rb', line 21 def size @size end |
#total_size ⇒ Fixnum (readonly)
Total size of all the assets combined.
29 30 31 |
# File 'lib/lapis/minecraft/versioning/asset_index.rb', line 29 def total_size @total_size end |
#url ⇒ String (readonly)
Location of where the asset list document can be found.
25 26 27 |
# File 'lib/lapis/minecraft/versioning/asset_index.rb', line 25 def url @url end |
Instance Method Details
#==(other) ⇒ true, false
Compares one asset index to another.
49 50 51 52 53 54 55 |
# File 'lib/lapis/minecraft/versioning/asset_index.rb', line 49 def ==(other) other.id == @id && other.sha1 == @sha1 && other.size == @size && other.url == @url && other.total_size == @total_size end |