Class: Lapis::Minecraft::Versioning::Rule

Inherits:
Object
  • Object
show all
Defined in:
lib/lapis/minecraft/versioning/rule.rb

Overview

Description of how resources can be chosen.

Direct Known Subclasses

OSRule

Instance Attribute Summary collapse

Instance Method Summary collapse

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.



24
25
26
# File 'lib/lapis/minecraft/versioning/rule.rb', line 24

def ==(other)
  other.allowed? == @is_allowed
end