Class: Rule
- Inherits:
-
Object
- Object
- Rule
- Defined in:
- lib/patterns/rule.rb
Instance Method Summary collapse
- #applicable? ⇒ Boolean
- #forceable? ⇒ Boolean
-
#initialize(subject) ⇒ Rule
constructor
A new instance of Rule.
- #not_applicable? ⇒ Boolean
- #satisfied? ⇒ Boolean
Constructor Details
#initialize(subject) ⇒ Rule
Returns a new instance of Rule.
2 3 4 |
# File 'lib/patterns/rule.rb', line 2 def initialize(subject) @subject = subject end |
Instance Method Details
#applicable? ⇒ Boolean
14 15 16 |
# File 'lib/patterns/rule.rb', line 14 def applicable? !not_applicable? end |
#forceable? ⇒ Boolean
18 19 20 |
# File 'lib/patterns/rule.rb', line 18 def forceable? true end |
#not_applicable? ⇒ Boolean
10 11 12 |
# File 'lib/patterns/rule.rb', line 10 def not_applicable? false end |
#satisfied? ⇒ Boolean
6 7 8 |
# File 'lib/patterns/rule.rb', line 6 def satisfied? raise NotImplementedError end |