Class: Ripe::CLI::Helper
- Inherits:
-
Object
- Object
- Ripe::CLI::Helper
- Defined in:
- lib/ripe/cli/helper.rb
Overview
This class defines helper methods for Ripe::CLI.
Class Method Summary collapse
-
.parse_cli_opts(options) ⇒ Hash
Parses a string representing a hash in the format of a=1,b=2,c=3 into a hash in the format of {a: 1, b: 2, c: 3}.
Class Method Details
.parse_cli_opts(options) ⇒ Hash
Parses a string representing a hash in the format of a=1,b=2,c=3 into a hash in the format of {a: 1, b: 2, c: 3}.
19 20 21 22 23 24 25 |
# File 'lib/ripe/cli/helper.rb', line 19 def self.parse_cli_opts() params = .split(/,/).map do |pair| key, value = pair.split(/=/) { key.to_sym => value } end params.inject(&:merge) || {} end |