Class: Lapis::Minecraft::Versioning::Resource
- Defined in:
- lib/lapis/minecraft/versioning/resource.rb
Overview
Information about a resource (file) to download as part of the client or server.
Instance Attribute Summary collapse
-
#classifier ⇒ String?
readonly
Logical category the resource falls under.
-
#url ⇒ String
readonly
URL where the resource can be found and downloaded from.
Attributes inherited from Asset
Instance Method Summary collapse
-
#==(other) ⇒ true, false
Compares one resource to another.
-
#initialize(url, size, sha1, path = nil, classifier = nil) ⇒ Resource
constructor
Creates information about a resource.
Constructor Details
#initialize(url, size, sha1, path = nil, classifier = nil) ⇒ Resource
Creates information about a resource.
24 25 26 27 28 |
# File 'lib/lapis/minecraft/versioning/resource.rb', line 24 def initialize(url, size, sha1, path = nil, classifier = nil) super(size, sha1, path) @url = url.dup.freeze @classifier = classifier.dup.freeze end |
Instance Attribute Details
#classifier ⇒ String? (readonly)
Logical category the resource falls under.
16 17 18 |
# File 'lib/lapis/minecraft/versioning/resource.rb', line 16 def classifier @classifier end |
#url ⇒ String (readonly)
URL where the resource can be found and downloaded from.
12 13 14 |
# File 'lib/lapis/minecraft/versioning/resource.rb', line 12 def url @url end |
Instance Method Details
#==(other) ⇒ true, false
Compares one resource to another.
34 35 36 37 38 |
# File 'lib/lapis/minecraft/versioning/resource.rb', line 34 def ==(other) super(other) && other.url == @url && other.classifier == @classifier end |