Module: Hookers::Command

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



9
10
11
# File 'lib/hookers/command.rb', line 9

def self.included(base)
  Hookers.commands[base.name.gsub(/^Hookers::Commands::/, "").downcase] = base
end

Instance Method Details

#parse_options(args) ⇒ Object



13
14
15
16
17
18
19
# File 'lib/hookers/command.rb', line 13

def parse_options(args)
  if self.class.respond_to?(:slop)
    slop = self.class.slop
    slop.parse(args)
    slop.to_hash
  end
end