class Swat::BaseCommand
Defines the basic behavior of a command
Inherith to reuse all this logic, only pre-check and execute are mandatory methods the rest can be as is
Use the context object to send state from one stage to the next
Public Class Methods
new(args)
click to toggle source
# File lib/swat.rb, line 14 def initialize(args) @args = args end
Public Instance Methods
execute(_context)
click to toggle source
# File lib/swat.rb, line 26 def execute(_context) fail "Execution is not defined" end
pre_check(_context)
click to toggle source
# File lib/swat.rb, line 22 def pre_check(_context) fail "PreChecks are not defined" end
prepare(_context)
click to toggle source
# File lib/swat.rb, line 18 def prepare(_context) # validate arguments here end