Class: Patterns::Rule
- Inherits:
-
Object
- Object
- Patterns::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.
3 4 5 |
# File 'lib/patterns/rule.rb', line 3 def initialize(subject) @subject = subject end |
Instance Method Details
#applicable? ⇒ Boolean
15 16 17 |
# File 'lib/patterns/rule.rb', line 15 def applicable? !not_applicable? end |
#forceable? ⇒ Boolean
19 20 21 |
# File 'lib/patterns/rule.rb', line 19 def forceable? true end |
#not_applicable? ⇒ Boolean
11 12 13 |
# File 'lib/patterns/rule.rb', line 11 def not_applicable? false end |
#satisfied? ⇒ Boolean
7 8 9 |
# File 'lib/patterns/rule.rb', line 7 def satisfied? raise NotImplementedError end |