Class: Mcoin::Command::Base
- Inherits:
-
OptionParser
- Object
- OptionParser
- Mcoin::Command::Base
- Defined in:
- lib/mcoin/command/base.rb
Overview
:nodoc:
Defined Under Namespace
Classes: Option
Class Attribute Summary collapse
-
.commands ⇒ Object
readonly
Returns the value of attribute commands.
-
.options ⇒ Object
readonly
Returns the value of attribute options.
Instance Attribute Summary collapse
-
#option ⇒ Object
readonly
Returns the value of attribute option.
Class Method Summary collapse
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize ⇒ Base
constructor
A new instance of Base.
- #parse! ⇒ Object
- #prepare ⇒ Object
Constructor Details
#initialize ⇒ Base
Returns a new instance of Base.
23 24 25 26 27 28 29 |
# File 'lib/mcoin/command/base.rb', line 23 def initialize super prepare self. = '=== Mcoin : BTC Monitor Tool ===' self.class.&.each { |option| option.register(self) } end |
Class Attribute Details
.commands ⇒ Object (readonly)
Returns the value of attribute commands.
8 9 10 |
# File 'lib/mcoin/command/base.rb', line 8 def commands @commands end |
.options ⇒ Object (readonly)
Returns the value of attribute options.
8 9 10 |
# File 'lib/mcoin/command/base.rb', line 8 def @options end |
Instance Attribute Details
#option ⇒ Object (readonly)
Returns the value of attribute option.
21 22 23 |
# File 'lib/mcoin/command/base.rb', line 21 def option @option end |
Class Method Details
.description(description = nil) ⇒ Object
10 11 12 13 |
# File 'lib/mcoin/command/base.rb', line 10 def description(description = nil) return @description if description.nil? @description = description end |
Instance Method Details
#execute ⇒ Object
40 41 42 |
# File 'lib/mcoin/command/base.rb', line 40 def execute raise NotImplementedError end |
#parse! ⇒ Object
35 36 37 38 |
# File 'lib/mcoin/command/base.rb', line 35 def parse! super self end |
#prepare ⇒ Object
31 32 33 |
# File 'lib/mcoin/command/base.rb', line 31 def prepare @option = OpenStruct.new end |