Class: EY::Serverside::Callbacks::Executor::Base

Inherits:
Object
  • Object
show all
Includes:
Railway
Defined in:
lib/engineyard-serverside/callbacks/executor/base.rb

Direct Known Subclasses

Executable, Ruby::Executor

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Railway

#call, included

Methods included from Result::DSL

#Failure, #Success

Constructor Details

#initialize(config, shell, hook) ⇒ Base

Returns a new instance of Base.



17
18
19
20
21
# File 'lib/engineyard-serverside/callbacks/executor/base.rb', line 17

def initialize(config, shell, hook)
  @config = config
  @shell = shell
  @hook = hook
end

Instance Attribute Details

#configObject (readonly)

Returns the value of attribute config.



11
12
13
# File 'lib/engineyard-serverside/callbacks/executor/base.rb', line 11

def config
  @config
end

#hookObject (readonly)

Returns the value of attribute hook.



11
12
13
# File 'lib/engineyard-serverside/callbacks/executor/base.rb', line 11

def hook
  @hook
end

#shellObject (readonly)

Returns the value of attribute shell.



11
12
13
# File 'lib/engineyard-serverside/callbacks/executor/base.rb', line 11

def shell
  @shell
end

Class Method Details

.execute(config, shell, hook) ⇒ Object



13
14
15
# File 'lib/engineyard-serverside/callbacks/executor/base.rb', line 13

def self.execute(config, shell, hook)
  new(config, shell, hook).execute
end

Instance Method Details

#executeObject



23
24
25
# File 'lib/engineyard-serverside/callbacks/executor/base.rb', line 23

def execute
  call.or_else {|payload| handle_failure(payload)}
end

#handle_failure(payload = {}) ⇒ Object



27
28
29
# File 'lib/engineyard-serverside/callbacks/executor/base.rb', line 27

def handle_failure(payload = {})
  raise "Unimplemented Hook Executor!"
end

#hook_pathObject



35
36
37
# File 'lib/engineyard-serverside/callbacks/executor/base.rb', line 35

def hook_path
  hook.path
end

#pathsObject



31
32
33
# File 'lib/engineyard-serverside/callbacks/executor/base.rb', line 31

def paths
  config.paths
end