Class: MetricFu::Cli::MicroOptParse::Parser
- Inherits:
-
Object
- Object
- MetricFu::Cli::MicroOptParse::Parser
- Defined in:
- lib/metric_fu/cli/parser.rb
Instance Attribute Summary collapse
-
#banner ⇒ Object
Returns the value of attribute banner.
-
#version ⇒ Object
Returns the value of attribute version.
Instance Method Summary collapse
-
#initialize {|_self| ... } ⇒ Parser
constructor
A new instance of Parser.
- #option(name, desc, settings = {}) ⇒ Object
- #process!(arguments = ARGV) ⇒ Object
Constructor Details
#initialize {|_self| ... } ⇒ Parser
Returns a new instance of Parser.
9 10 11 12 13 14 |
# File 'lib/metric_fu/cli/parser.rb', line 9 def initialize @options = [] @used_short = [] @default_values = nil yield self if block_given? end |
Instance Attribute Details
#banner ⇒ Object
Returns the value of attribute banner.
8 9 10 |
# File 'lib/metric_fu/cli/parser.rb', line 8 def @banner end |
#version ⇒ Object
Returns the value of attribute version.
8 9 10 |
# File 'lib/metric_fu/cli/parser.rb', line 8 def version @version end |
Instance Method Details
#option(name, desc, settings = {}) ⇒ Object
21 22 23 |
# File 'lib/metric_fu/cli/parser.rb', line 21 def option(name, desc, settings = {}) @options << [name, desc, settings] end |
#process!(arguments = ARGV) ⇒ Object
16 17 18 19 |
# File 'lib/metric_fu/cli/parser.rb', line 16 def process!(arguments = ARGV) parser = build_option_parser (parser, arguments) end |