Class: MisterBin::DocoptMaker
- Inherits:
-
Object
- Object
- MisterBin::DocoptMaker
- Includes:
- Colsole, Singleton
- Defined in:
- lib/mister_bin/docopt_maker.rb
Overview
This singleton class is responsible for generating a text string ready to be used by Docopt.
Instance Attribute Summary collapse
-
#examples ⇒ Object
readonly
Returns the value of attribute examples.
-
#help ⇒ Object
Returns the value of attribute help.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#params ⇒ Object
readonly
Returns the value of attribute params.
-
#usages ⇒ Object
readonly
Returns the value of attribute usages.
-
#version ⇒ Object
Returns the value of attribute version.
Instance Method Summary collapse
- #docopt ⇒ Object
-
#initialize ⇒ DocoptMaker
constructor
A new instance of DocoptMaker.
- #reset ⇒ Object
Constructor Details
#initialize ⇒ DocoptMaker
Returns a new instance of DocoptMaker.
15 16 17 |
# File 'lib/mister_bin/docopt_maker.rb', line 15 def initialize reset end |
Instance Attribute Details
#examples ⇒ Object (readonly)
Returns the value of attribute examples.
12 13 14 |
# File 'lib/mister_bin/docopt_maker.rb', line 12 def examples @examples end |
#help ⇒ Object
Returns the value of attribute help.
13 14 15 |
# File 'lib/mister_bin/docopt_maker.rb', line 13 def help @help end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
12 13 14 |
# File 'lib/mister_bin/docopt_maker.rb', line 12 def @options end |
#params ⇒ Object (readonly)
Returns the value of attribute params.
12 13 14 |
# File 'lib/mister_bin/docopt_maker.rb', line 12 def params @params end |
#usages ⇒ Object (readonly)
Returns the value of attribute usages.
12 13 14 |
# File 'lib/mister_bin/docopt_maker.rb', line 12 def usages @usages end |
#version ⇒ Object
Returns the value of attribute version.
13 14 15 |
# File 'lib/mister_bin/docopt_maker.rb', line 13 def version @version end |
Instance Method Details
#docopt ⇒ Object
28 29 30 31 |
# File 'lib/mister_bin/docopt_maker.rb', line 28 def docopt [help_string, usage_string, , params_string, examples_string].compact.join "\n" end |
#reset ⇒ Object
19 20 21 22 23 24 25 26 |
# File 'lib/mister_bin/docopt_maker.rb', line 19 def reset @usages = [] @options = [] @params = [] @examples = [] @version = '0.0.0' @help = nil end |