Class: Easyhooks::Specification
- Inherits:
-
Object
- Object
- Easyhooks::Specification
- Includes:
- Helpers, Validators
- Defined in:
- lib/easyhooks/specification.rb
Constant Summary
Constants included from Validators
Validators::ALLOWED_METHODS, Validators::ALLOWED_ON_VALUES, Validators::ALLOWED_TYPES
Instance Attribute Summary collapse
-
#actions ⇒ Object
Returns the value of attribute actions.
-
#global_args ⇒ Object
Returns the value of attribute global_args.
-
#name ⇒ Object
Returns the value of attribute name.
-
#scoped_action ⇒ Object
Returns the value of attribute scoped_action.
-
#scoped_trigger ⇒ Object
Returns the value of attribute scoped_trigger.
-
#triggers ⇒ Object
Returns the value of attribute triggers.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(name, type, args = {}, &specification) ⇒ Specification
constructor
A new instance of Specification.
Constructor Details
#initialize(name, type, args = {}, &specification) ⇒ Specification
Returns a new instance of Specification.
16 17 18 19 20 21 22 23 |
# File 'lib/easyhooks/specification.rb', line 16 def initialize(name, type, args = {}, &specification) @name = name @type = type @global_args = args.merge({ type: type }) @triggers = {} @actions = {} instance_eval(&specification) end |
Instance Attribute Details
#actions ⇒ Object
Returns the value of attribute actions.
14 15 16 |
# File 'lib/easyhooks/specification.rb', line 14 def actions @actions end |
#global_args ⇒ Object
Returns the value of attribute global_args.
14 15 16 |
# File 'lib/easyhooks/specification.rb', line 14 def global_args @global_args end |
#name ⇒ Object
Returns the value of attribute name.
14 15 16 |
# File 'lib/easyhooks/specification.rb', line 14 def name @name end |
#scoped_action ⇒ Object
Returns the value of attribute scoped_action.
14 15 16 |
# File 'lib/easyhooks/specification.rb', line 14 def scoped_action @scoped_action end |
#scoped_trigger ⇒ Object
Returns the value of attribute scoped_trigger.
14 15 16 |
# File 'lib/easyhooks/specification.rb', line 14 def scoped_trigger @scoped_trigger end |
#triggers ⇒ Object
Returns the value of attribute triggers.
14 15 16 |
# File 'lib/easyhooks/specification.rb', line 14 def triggers @triggers end |
#type ⇒ Object
Returns the value of attribute type.
14 15 16 |
# File 'lib/easyhooks/specification.rb', line 14 def type @type end |