Class: Easyhooks::Specification

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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

#actionsObject

Returns the value of attribute actions.



14
15
16
# File 'lib/easyhooks/specification.rb', line 14

def actions
  @actions
end

#global_argsObject

Returns the value of attribute global_args.



14
15
16
# File 'lib/easyhooks/specification.rb', line 14

def global_args
  @global_args
end

#nameObject

Returns the value of attribute name.



14
15
16
# File 'lib/easyhooks/specification.rb', line 14

def name
  @name
end

#scoped_actionObject

Returns the value of attribute scoped_action.



14
15
16
# File 'lib/easyhooks/specification.rb', line 14

def scoped_action
  @scoped_action
end

#scoped_triggerObject

Returns the value of attribute scoped_trigger.



14
15
16
# File 'lib/easyhooks/specification.rb', line 14

def scoped_trigger
  @scoped_trigger
end

#triggersObject

Returns the value of attribute triggers.



14
15
16
# File 'lib/easyhooks/specification.rb', line 14

def triggers
  @triggers
end

#typeObject

Returns the value of attribute type.



14
15
16
# File 'lib/easyhooks/specification.rb', line 14

def type
  @type
end