Module: Lite::Command::Internals::Executable

Defined in:
lib/lite/command/internals/executable.rb

Instance Method Summary collapse

Instance Method Details

#executeObject



16
17
18
19
20
21
22
23
24
# File 'lib/lite/command/internals/executable.rb', line 16

def execute
  around_execution { call }
rescue StandardError => e
  f = e.respond_to?(:type) ? e.type : ERROR

  send(:"#{f}", e)
  after_execution
  send(:"on_#{f}", e)
end

#execute!Object



26
27
28
29
30
31
# File 'lib/lite/command/internals/executable.rb', line 26

def execute!
  around_execution { call }
rescue StandardError => e
  after_execution
  raise(e)
end

#executed?Boolean

Returns:

  • (Boolean)


37
38
39
# File 'lib/lite/command/internals/executable.rb', line 37

def executed?
  complete? || interrupted?
end

#stateObject



33
34
35
# File 'lib/lite/command/internals/executable.rb', line 33

def state
  @state || PENDING
end