Class: CustomActiveRecordObserver::Rules::BaseRule
- Inherits:
-
Object
- Object
- CustomActiveRecordObserver::Rules::BaseRule
show all
- Defined in:
- lib/custom_active_record_observer/rules/base_rule.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
#initialize(block) ⇒ BaseRule
6
7
8
|
# File 'lib/custom_active_record_observer/rules/base_rule.rb', line 6
def initialize(block)
@block = block
end
|
Instance Attribute Details
#block ⇒ Object
Returns the value of attribute block.
4
5
6
|
# File 'lib/custom_active_record_observer/rules/base_rule.rb', line 4
def block
@block
end
|
Instance Method Details
#allowed?(changes) ⇒ Boolean
14
15
16
|
# File 'lib/custom_active_record_observer/rules/base_rule.rb', line 14
def allowed?(changes)
raise NotImplementedError
end
|
#call(target) ⇒ Object
10
11
12
|
# File 'lib/custom_active_record_observer/rules/base_rule.rb', line 10
def call(target)
block.call(target)
end
|