Class: Easyhooks::Base
- Inherits:
-
Object
- Object
- Easyhooks::Base
- Includes:
- Helpers, Validators
- Defined in:
- lib/easyhooks/base.rb
Constant Summary
Constants included from Validators
Validators::ALLOWED_METHODS, Validators::ALLOWED_ON_VALUES, Validators::ALLOWED_TYPES
Instance Attribute Summary collapse
-
#condition ⇒ Object
Returns the value of attribute condition.
-
#hook ⇒ Object
Returns the value of attribute hook.
-
#name ⇒ Object
Returns the value of attribute name.
-
#on_fail ⇒ Object
Returns the value of attribute on_fail.
-
#payload ⇒ Object
Returns the value of attribute payload.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(name, type, hook, condition, payload, on_fail) ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(name, type, hook, condition, payload, on_fail) ⇒ Base
Returns a new instance of Base.
13 14 15 16 17 18 19 20 |
# File 'lib/easyhooks/base.rb', line 13 def initialize(name, type, hook, condition, payload, on_fail) @name = validate_name(name) @type = validate_type(type) @hook = hook @condition = validate_callback(condition, 'if') @payload = validate_callback(payload, 'payload') @on_fail = validate_callback(on_fail, 'on_fail') end |
Instance Attribute Details
#condition ⇒ Object
Returns the value of attribute condition.
11 12 13 |
# File 'lib/easyhooks/base.rb', line 11 def condition @condition end |
#hook ⇒ Object
Returns the value of attribute hook.
11 12 13 |
# File 'lib/easyhooks/base.rb', line 11 def hook @hook end |
#name ⇒ Object
Returns the value of attribute name.
11 12 13 |
# File 'lib/easyhooks/base.rb', line 11 def name @name end |
#on_fail ⇒ Object
Returns the value of attribute on_fail.
11 12 13 |
# File 'lib/easyhooks/base.rb', line 11 def on_fail @on_fail end |
#payload ⇒ Object
Returns the value of attribute payload.
11 12 13 |
# File 'lib/easyhooks/base.rb', line 11 def payload @payload end |
#type ⇒ Object
Returns the value of attribute type.
11 12 13 |
# File 'lib/easyhooks/base.rb', line 11 def type @type end |