Class: Checken::RuleExecution

Inherits:
Object
  • Object
show all
Defined in:
lib/checken/rule_execution.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(rule, user, object = nil) ⇒ RuleExecution

Returns a new instance of RuleExecution.



9
10
11
12
13
14
# File 'lib/checken/rule_execution.rb', line 9

def initialize(rule, user, object = nil)
  @rule = rule
  @user = user
  @object = object
  @memo = {}
end

Instance Attribute Details

#memoObject (readonly)

Returns the value of attribute memo.



7
8
9
# File 'lib/checken/rule_execution.rb', line 7

def memo
  @memo
end

#objectObject (readonly)

Returns the value of attribute object.



6
7
8
# File 'lib/checken/rule_execution.rb', line 6

def object
  @object
end

#ruleObject (readonly)

Returns the value of attribute rule.



4
5
6
# File 'lib/checken/rule_execution.rb', line 4

def rule
  @rule
end

#userObject (readonly)

Returns the value of attribute user.



5
6
7
# File 'lib/checken/rule_execution.rb', line 5

def user
  @user
end

Instance Method Details

#satisfied?Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/checken/rule_execution.rb', line 16

def satisfied?
  @rule.satisfied?(self)
end