Class: USaidWat::Application::Command
- Inherits:
-
Object
- Object
- USaidWat::Application::Command
show all
- Includes:
- Pager, Sysexits
- Defined in:
- lib/usaidwat/command.rb
Instance Attribute Summary collapse
Class Method Summary
collapse
Instance Method Summary
collapse
Methods included from Pager
#page
Constructor Details
#initialize(prog) ⇒ Command
Returns a new instance of Command.
Instance Attribute Details
#client ⇒ Object
Returns the value of attribute client.
13
14
15
|
# File 'lib/usaidwat/command.rb', line 13
def client
@client
end
|
Class Method Details
.inherited(base) ⇒ Object
20
21
22
23
|
# File 'lib/usaidwat/command.rb', line 20
def inherited(base)
subclasses << base
super
end
|
.subclasses ⇒ Object
16
17
18
|
# File 'lib/usaidwat/command.rb', line 16
def subclasses
@subclasses ||= []
end
|
Instance Method Details
#quit(message, code = :ok) ⇒ Object
31
32
33
34
35
|
# File 'lib/usaidwat/command.rb', line 31
def quit(message, code=:ok)
stream = code == :ok ? $stdout : $stderr
stream.puts message
exit code
end
|