Class: CustomActiveRecordObserver::Rules::BaseRule
- Inherits:
-
Object
- Object
- CustomActiveRecordObserver::Rules::BaseRule
- Defined in:
- lib/custom_active_record_observer/rules/base_rule.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#block ⇒ Object
readonly
Returns the value of attribute block.
Instance Method Summary collapse
- #allowed?(changes) ⇒ Boolean
- #call(target) ⇒ Object
-
#initialize(block) ⇒ BaseRule
constructor
A new instance of BaseRule.
Constructor Details
#initialize(block) ⇒ BaseRule
Returns a new instance of 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 (readonly)
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 |