Class: Patterns::Rule

Inherits:
Object
  • Object
show all
Defined in:
lib/patterns/rule.rb

Instance Method Summary collapse

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

Returns:

  • (Boolean)


15
16
17
# File 'lib/patterns/rule.rb', line 15

def applicable?
  !not_applicable?
end

#forceable?Boolean

Returns:

  • (Boolean)


19
20
21
# File 'lib/patterns/rule.rb', line 19

def forceable?
  true
end

#not_applicable?Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/patterns/rule.rb', line 11

def not_applicable?
  false
end

#satisfied?Boolean

Returns:

  • (Boolean)

Raises:

  • (NotImplementedError)


7
8
9
# File 'lib/patterns/rule.rb', line 7

def satisfied?
  raise NotImplementedError
end