Class: CLIApp::Config
- Inherits:
-
Object
- Object
- CLIApp::Config
- Defined in:
- lib/cliapp.rb
Instance Attribute Summary collapse
-
#actionlist_format ⇒ Object
Returns the value of attribute actionlist_format.
-
#actionlist_width ⇒ Object
Returns the value of attribute actionlist_width.
-
#command ⇒ Object
Returns the value of attribute command.
-
#desc ⇒ Object
Returns the value of attribute desc.
-
#help_action_width ⇒ Object
Returns the value of attribute help_action_width.
-
#help_indent ⇒ Object
Returns the value of attribute help_indent.
-
#help_option_width ⇒ Object
Returns the value of attribute help_option_width.
-
#name ⇒ Object
Returns the value of attribute name.
-
#version ⇒ Object
Returns the value of attribute version.
Instance Method Summary collapse
-
#initialize(name: nil, desc: nil, version: nil, command: nil, help_indent: nil, help_option_width: nil, help_action_width: nil, actionlist_width: nil, actionlist_format: nil) ⇒ Config
constructor
A new instance of Config.
Constructor Details
#initialize(name: nil, desc: nil, version: nil, command: nil, help_indent: nil, help_option_width: nil, help_action_width: nil, actionlist_width: nil, actionlist_format: nil) ⇒ Config
Returns a new instance of Config.
56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
# File 'lib/cliapp.rb', line 56 def initialize(name: nil, desc: nil, version: nil, command: nil, help_indent: nil, help_option_width: nil, help_action_width: nil, actionlist_width: nil, actionlist_format: nil) command ||= File.basename($0) @name = name || command # ex: "FooBar" @desc = desc # ex: "Foo Bar application" @command = command # ex: "foobar" @version = version # ex: "1.0.0" @help_indent = help_indent || " " @help_option_width = help_option_width || 22 @help_action_width = help_action_width || 22 @actionlist_width = actionlist_width || 16 @actionlist_format = actionlist_format || nil # ex: "%-16s : %s" end |
Instance Attribute Details
#actionlist_format ⇒ Object
Returns the value of attribute actionlist_format.
73 74 75 |
# File 'lib/cliapp.rb', line 73 def actionlist_format @actionlist_format end |
#actionlist_width ⇒ Object
Returns the value of attribute actionlist_width.
73 74 75 |
# File 'lib/cliapp.rb', line 73 def actionlist_width @actionlist_width end |
#command ⇒ Object
Returns the value of attribute command.
71 72 73 |
# File 'lib/cliapp.rb', line 71 def command @command end |
#desc ⇒ Object
Returns the value of attribute desc.
71 72 73 |
# File 'lib/cliapp.rb', line 71 def desc @desc end |
#help_action_width ⇒ Object
Returns the value of attribute help_action_width.
72 73 74 |
# File 'lib/cliapp.rb', line 72 def help_action_width @help_action_width end |
#help_indent ⇒ Object
Returns the value of attribute help_indent.
72 73 74 |
# File 'lib/cliapp.rb', line 72 def help_indent @help_indent end |
#help_option_width ⇒ Object
Returns the value of attribute help_option_width.
72 73 74 |
# File 'lib/cliapp.rb', line 72 def help_option_width @help_option_width end |
#name ⇒ Object
Returns the value of attribute name.
71 72 73 |
# File 'lib/cliapp.rb', line 71 def name @name end |
#version ⇒ Object
Returns the value of attribute version.
71 72 73 |
# File 'lib/cliapp.rb', line 71 def version @version end |