Class: Cranium::CommandLineOptions
- Inherits:
-
Object
- Object
- Cranium::CommandLineOptions
- Defined in:
- lib/cranium/command_line_options.rb
Instance Method Summary collapse
- #cranium_arguments ⇒ Object
-
#initialize(arguments) ⇒ CommandLineOptions
constructor
A new instance of CommandLineOptions.
- #load_arguments ⇒ Object
Constructor Details
#initialize(arguments) ⇒ CommandLineOptions
Returns a new instance of CommandLineOptions.
5 6 7 |
# File 'lib/cranium/command_line_options.rb', line 5 def initialize(arguments) @arguments = Slop.parse(arguments, autocreate: true).to_hash end |
Instance Method Details
#cranium_arguments ⇒ Object
11 12 13 |
# File 'lib/cranium/command_line_options.rb', line 11 def cranium_arguments @cranium_arguments ||= Hash[arguments.map { |k, v| [$1.to_sym, v] if k.to_s =~ /\Acranium\-(.*)/ }.compact] end |
#load_arguments ⇒ Object
17 18 19 |
# File 'lib/cranium/command_line_options.rb', line 17 def load_arguments @load_arguments ||= Hash[arguments.map { |k, v| [k, v] unless k.to_s =~ /\Acranium\-(.*)/ }.compact] end |