Class: Mmac::Rule
- Inherits:
-
Object
- Object
- Mmac::Rule
- Defined in:
- lib/mmac/rule.rb
Overview
Main Data/Rule for MMac (in here is mushroom, …)
Instance Attribute Summary collapse
-
#actOccr ⇒ Object
ActOccr.
-
#conditions ⇒ Object
Array of conditions.
-
#conf ⇒ Object
Conf of rule.
-
#labels ⇒ Object
Array of labels: result of these conditions.
-
#supp ⇒ Object
Supp of rule.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(conditions, labels, *option) ⇒ Rule
constructor
A new instance of Rule.
- #isParent?(other) ⇒ Boolean
Constructor Details
#initialize(conditions, labels, *option) ⇒ Rule
Returns a new instance of Rule.
28 29 30 31 32 33 34 35 36 |
# File 'lib/mmac/rule.rb', line 28 def initialize (conditions, labels, *option) @conditions = conditions @labels = labels if !option.empty? @supp = option[0] @conf = option[1] @actOccr = option[2] end end |
Instance Attribute Details
#actOccr ⇒ Object
Returns actOccr.
26 27 28 |
# File 'lib/mmac/rule.rb', line 26 def actOccr @actOccr end |
#conditions ⇒ Object
Returns Array of conditions.
10 11 12 |
# File 'lib/mmac/rule.rb', line 10 def conditions @conditions end |
#conf ⇒ Object
Returns Conf of rule.
22 23 24 |
# File 'lib/mmac/rule.rb', line 22 def conf @conf end |
#labels ⇒ Object
Returns array of labels: result of these conditions.
14 15 16 |
# File 'lib/mmac/rule.rb', line 14 def labels @labels end |
#supp ⇒ Object
Returns Supp of rule.
18 19 20 |
# File 'lib/mmac/rule.rb', line 18 def supp @supp end |
Instance Method Details
#==(other) ⇒ Object
38 39 40 |
# File 'lib/mmac/rule.rb', line 38 def ==(other) self.conditions == other.conditions && self.labels == other.labels end |
#isParent?(other) ⇒ Boolean
42 43 44 |
# File 'lib/mmac/rule.rb', line 42 def isParent?(other) (self.conditions - other.conditions).empty? && self.labels == other.labels end |