Class: SimpleRules::Rule
- Inherits:
-
Object
- Object
- SimpleRules::Rule
- Defined in:
- lib/simple_rules/rule.rb
Instance Attribute Summary collapse
-
#action ⇒ Object
Returns the value of attribute action.
-
#block ⇒ Object
Returns the value of attribute block.
-
#error_message ⇒ Object
Returns the value of attribute error_message.
-
#object_name ⇒ Object
Returns the value of attribute object_name.
Instance Method Summary collapse
-
#initialize(action, object_name, error_message, &block) ⇒ Rule
constructor
A new instance of Rule.
Constructor Details
#initialize(action, object_name, error_message, &block) ⇒ Rule
Returns a new instance of Rule.
5 6 7 8 9 10 11 12 |
# File 'lib/simple_rules/rule.rb', line 5 def initialize (action, object_name, , &block) @action = action @object_name = object_name @block = block = raise ArgumentError, 'Block is not given' unless block end |
Instance Attribute Details
#action ⇒ Object
Returns the value of attribute action.
3 4 5 |
# File 'lib/simple_rules/rule.rb', line 3 def action @action end |
#block ⇒ Object
Returns the value of attribute block.
3 4 5 |
# File 'lib/simple_rules/rule.rb', line 3 def block @block end |
#error_message ⇒ Object
Returns the value of attribute error_message.
3 4 5 |
# File 'lib/simple_rules/rule.rb', line 3 def end |
#object_name ⇒ Object
Returns the value of attribute object_name.
3 4 5 |
# File 'lib/simple_rules/rule.rb', line 3 def object_name @object_name end |