Class: Yard2steep::CLI::Option
- Inherits:
-
Object
- Object
- Yard2steep::CLI::Option
- Defined in:
- lib/yard2steep/cli/option.rb
Instance Attribute Summary collapse
-
#debug ⇒ Object
readonly
Returns the value of attribute debug.
-
#debug_ast ⇒ Object
readonly
Returns the value of attribute debug_ast.
-
#dst ⇒ Object
readonly
Returns the value of attribute dst.
-
#src ⇒ Object
readonly
Returns the value of attribute src.
Instance Method Summary collapse
-
#initialize ⇒ Option
constructor
A new instance of Option.
- #parse!(argv) ⇒ Object
Constructor Details
#initialize ⇒ Option
Returns a new instance of Option.
9 10 11 12 13 14 |
# File 'lib/yard2steep/cli/option.rb', line 9 def initialize @src = '.' # NOTE: Current directory is used as default @dst = 'sig' @debug = false @debug_ast = false end |
Instance Attribute Details
#debug ⇒ Object (readonly)
Returns the value of attribute debug.
7 8 9 |
# File 'lib/yard2steep/cli/option.rb', line 7 def debug @debug end |
#debug_ast ⇒ Object (readonly)
Returns the value of attribute debug_ast.
7 8 9 |
# File 'lib/yard2steep/cli/option.rb', line 7 def debug_ast @debug_ast end |
#dst ⇒ Object (readonly)
Returns the value of attribute dst.
7 8 9 |
# File 'lib/yard2steep/cli/option.rb', line 7 def dst @dst end |
#src ⇒ Object (readonly)
Returns the value of attribute src.
7 8 9 |
# File 'lib/yard2steep/cli/option.rb', line 7 def src @src end |
Instance Method Details
#parse!(argv) ⇒ Object
16 17 18 19 20 21 22 23 24 |
# File 'lib/yard2steep/cli/option.rb', line 16 def parse!(argv) opt = OptionParser.new opt.on('--debug') { |v| @debug = true } opt.on('--debug-ast') { |v| @debug_ast = true } opt.parse!(argv) @src = argv[0] if argv[0] @dst = argv[1] if argv[1] end |