Class: Dcs::Debian::Command

Inherits:
Thor
  • Object
show all
Defined in:
lib/dcs/debian.rb

Class Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(id, *arguments) ⇒ Object (private)



36
37
38
# File 'lib/dcs/debian.rb', line 36

def method_missing(id, *arguments)
  dcs_search(id.to_s, arguments[0])
end

Class Method Details

.define_commands(name) ⇒ Object



13
14
15
16
17
18
# File 'lib/dcs/debian.rb', line 13

def self.define_commands(name)
  desc "#{name} KEYWORD", "Search debian/#{name} file"
  define_method(name) do |*args, &block|
    dcs_search(name.to_s, args[0])
  end
end