Class: Lapis::Minecraft::Versioning::Asset
- Inherits:
-
Object
- Object
- Lapis::Minecraft::Versioning::Asset
- Defined in:
- lib/lapis/minecraft/versioning/asset.rb
Overview
Information about a content file needed for the client.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#path ⇒ String?
readonly
Path, relative to the installation directory, to store the asset.
-
#sha1 ⇒ String
readonly
SHA1 hash of the asset’s contents in hexadecimal.
-
#size ⇒ Fixnum
readonly
Size of the asset in bytes.
Instance Method Summary collapse
-
#==(other) ⇒ true, false
Compares one asset to another.
-
#initialize(size, sha1, path) ⇒ Asset
constructor
Creates information about an asset.
Constructor Details
#initialize(size, sha1, path) ⇒ Asset
Creates information about an asset.
24 25 26 27 28 |
# File 'lib/lapis/minecraft/versioning/asset.rb', line 24 def initialize(size, sha1, path) @size = size @sha1 = sha1.dup.freeze @path = path ? path.dup.freeze : nil end |
Instance Attribute Details
#path ⇒ String? (readonly)
Path, relative to the installation directory, to store the asset.
18 19 20 |
# File 'lib/lapis/minecraft/versioning/asset.rb', line 18 def path @path end |
#sha1 ⇒ String (readonly)
SHA1 hash of the asset’s contents in hexadecimal.
14 15 16 |
# File 'lib/lapis/minecraft/versioning/asset.rb', line 14 def sha1 @sha1 end |
#size ⇒ Fixnum (readonly)
Size of the asset in bytes.
10 11 12 |
# File 'lib/lapis/minecraft/versioning/asset.rb', line 10 def size @size end |
Instance Method Details
#==(other) ⇒ true, false
Compares one asset to another.
34 35 36 37 38 |
# File 'lib/lapis/minecraft/versioning/asset.rb', line 34 def ==(other) other.size == @size && other.sha1 == @sha1 && other.path == @path end |