Class: Embedly::CommandLine::Parser
- Inherits:
-
Object
- Object
- Embedly::CommandLine::Parser
- Defined in:
- lib/embedly/command_line.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
Returns the value of attribute options.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(args) ⇒ Parser
constructor
A new instance of Parser.
- #parse! ⇒ Object
Constructor Details
#initialize(args) ⇒ Parser
Returns a new instance of Parser.
9 10 11 |
# File 'lib/embedly/command_line.rb', line 9 def initialize(args) @options, @args = default, args end |
Instance Attribute Details
#options ⇒ Object
Returns the value of attribute options.
7 8 9 |
# File 'lib/embedly/command_line.rb', line 7 def @options end |
Class Method Details
.parse!(args) ⇒ Object
24 25 26 |
# File 'lib/embedly/command_line.rb', line 24 def self.parse!(args) new(args).parse! end |
Instance Method Details
#parse! ⇒ Object
13 14 15 16 17 18 19 20 21 22 |
# File 'lib/embedly/command_line.rb', line 13 def parse! parser.parse!(@args) set_urls! reject_nil! rescue OptionParser::InvalidOption => error puts "ERROR: #{error.}" puts parser.on_tail exit end |