Class: I18nDefScanner::CliArguments

Inherits:
Object
  • Object
show all
Defined in:
lib/i18n_def_scanner/cli_arguments.rb

Constant Summary collapse

NAMED_ARGS_RE =
/--?([^=\s]+)(?:=(\S+))?/.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(argv_array) ⇒ CliArguments

Returns a new instance of CliArguments.



9
10
11
# File 'lib/i18n_def_scanner/cli_arguments.rb', line 9

def initialize(argv_array)
  self.argv_array = argv_array
end

Instance Attribute Details

#argv_arrayObject

Returns the value of attribute argv_array.



7
8
9
# File 'lib/i18n_def_scanner/cli_arguments.rb', line 7

def argv_array
  @argv_array
end

Instance Method Details

#help?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/i18n_def_scanner/cli_arguments.rb', line 17

def help?
  named_args.key?('help') || query_path.nil?
end

#to_hashObject



13
14
15
# File 'lib/i18n_def_scanner/cli_arguments.rb', line 13

def to_hash
  { query_path: query_path, load_path: load_path }.compact
end