Class: 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.



2
3
4
# File 'lib/patterns/rule.rb', line 2

def initialize(subject)
  @subject = subject
end

Instance Method Details

#applicable?Boolean

Returns:

  • (Boolean)


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

def applicable?
  !not_applicable?
end

#forceable?Boolean

Returns:

  • (Boolean)


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

def forceable?
  true
end

#not_applicable?Boolean

Returns:

  • (Boolean)


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

def not_applicable?
  false
end

#satisfied?Boolean

Returns:

  • (Boolean)

Raises:

  • (NotImplementedError)


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

def satisfied?
  raise NotImplementedError
end