Class: Thin::Command
- Inherits:
-
Object
- Object
- Thin::Command
- Defined in:
- lib/thin/command.rb
Overview
A command that can be runned from a command line script.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#args ⇒ Object
readonly
Returns the value of attribute args.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(non_options, options) ⇒ Command
constructor
A new instance of Command.
Constructor Details
#initialize(non_options, options) ⇒ Command
Returns a new instance of Command.
21 22 23 24 25 26 27 |
# File 'lib/thin/command.rb', line 21 def initialize(, ) @args = .each do |option, value| self.send("#{option}=", value) end end |
Instance Attribute Details
#args ⇒ Object (readonly)
Returns the value of attribute args.
19 20 21 |
# File 'lib/thin/command.rb', line 19 def args @args end |
Class Method Details
.command_name ⇒ Object
29 30 31 |
# File 'lib/thin/command.rb', line 29 def self.command_name self.name.match(/::(\w+)$/)[1].downcase end |
.detailed_help ⇒ Object
33 34 35 36 37 38 39 |
# File 'lib/thin/command.rb', line 33 def self.detailed_help <<-EOF usage: #{File.basename($PROGRAM_NAME)} #{command_name} #{help} EOF end |