Class: Intrinio::CommandLine
- Inherits:
-
Object
- Object
- Intrinio::CommandLine
- Includes:
- Singleton
- Defined in:
- lib/intrinio/command_line.rb
Overview
Handles the command line interface
Instance Method Summary collapse
-
#execute(argv = []) ⇒ Object
Gets an array of arguments (e.g. ARGV), executes the command if valid and shows usage patterns / help otherwise.
- #intrinio ⇒ Object
Instance Method Details
#execute(argv = []) ⇒ Object
Gets an array of arguments (e.g. ARGV), executes the command if valid and shows usage patterns / help otherwise.
14 15 16 17 18 19 20 21 22 |
# File 'lib/intrinio/command_line.rb', line 14 def execute(argv=[]) doc = File.read File.dirname(__FILE__) + '/docopt.txt' begin args = Docopt::docopt(doc, argv: argv, version: VERSION) handle args rescue Docopt::Exit, Intrinio::MissingAuth => e puts e. end end |
#intrinio ⇒ Object
24 25 26 |
# File 'lib/intrinio/command_line.rb', line 24 def intrinio @intrinio ||= intrinio! end |