Class: Lapis::Minecraft::Versioning::Rule
- Inherits:
-
Object
- Object
- Lapis::Minecraft::Versioning::Rule
- Defined in:
- lib/lapis/minecraft/versioning/rule.rb
Overview
Description of how resources can be chosen.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#allowed? ⇒ Boolean
readonly
Indicates whether the resource should be included.
Instance Method Summary collapse
-
#==(other) ⇒ true, false
Compares one rule to another.
-
#applies_to?(_properties) ⇒ true, false
Checks whether the rule applies to a set of properties.
-
#initialize(is_allowed) ⇒ Rule
constructor
Creates a basic rule.
Constructor Details
#initialize(is_allowed) ⇒ Rule
Creates a basic rule.
16 17 18 |
# File 'lib/lapis/minecraft/versioning/rule.rb', line 16 def initialize(is_allowed) @is_allowed = !!is_allowed end |
Instance Attribute Details
#allowed? ⇒ Boolean (readonly)
Indicates whether the resource should be included.
10 11 12 |
# File 'lib/lapis/minecraft/versioning/rule.rb', line 10 def allowed? @is_allowed end |
Instance Method Details
#==(other) ⇒ true, false
Compares one rule to another.
33 34 35 |
# File 'lib/lapis/minecraft/versioning/rule.rb', line 33 def ==(other) other.allowed? == @is_allowed end |
#applies_to?(_properties) ⇒ true, false
Note:
Base rules always apply.
Checks whether the rule applies to a set of properties.
25 26 27 |
# File 'lib/lapis/minecraft/versioning/rule.rb', line 25 def applies_to?(_properties) true end |