Class: Mcoin::Command::Common
- Defined in:
- lib/mcoin/command/common.rb
Overview
:nodoc:
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize ⇒ Common
constructor
A new instance of Common.
- #parse! ⇒ Object
- #print_commands ⇒ Object
Methods inherited from Base
Constructor Details
#initialize ⇒ Common
Returns a new instance of Common.
7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/mcoin/command/common.rb', line 7 def initialize super separator '' separator 'Commands: ' print_commands separator '' separator 'Options: ' on_tail('-v', '--version', 'Show versions') do puts "Mcoin #{Mcoin::VERSION}" exit end end |
Instance Method Details
#execute ⇒ Object
36 37 38 |
# File 'lib/mcoin/command/common.rb', line 36 def execute puts self end |
#parse! ⇒ Object
29 30 31 32 33 34 |
# File 'lib/mcoin/command/common.rb', line 29 def parse! super rescue OptionParser::InvalidOption puts self exit end |