Class: AssLauncher::Enterprise::Cli::Parameters::ParametersList Private

Inherits:
Object
  • Object
show all
Defined in:
lib/ass_launcher/enterprise/cli/parameters.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

List of parameters defined for one version

Raises:

  • (ArgumentError)

    if parameter alrady present in list

Instance Method Summary collapse

Instance Method Details

#<<(p) ⇒ Object Also known as: +, add

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Add parameter in to tail of list

Parameters:

Raises:

  • (ArgumentError)

    if parameter alrady present in list



427
428
429
430
431
432
# File 'lib/ass_launcher/enterprise/cli/parameters.rb', line 427

def <<(p)
  fail ArgumentError,
       "Parameter #{p.full_name} alrady defined" if\
          param_defined?(p)
  parameters << p
end

#each(&block) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

:nodoc:



452
453
454
# File 'lib/ass_launcher/enterprise/cli/parameters.rb', line 452

def each(&block)
  parameters.each(&block)
end

#find(name, parent) ⇒ StringParam Flag Path Switch Chose nil

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Find parameter in list

Parameters:

Returns:



441
442
443
444
445
446
447
448
449
# File 'lib/ass_launcher/enterprise/cli/parameters.rb', line 441

def find(name, parent)
  parameters.each do |p|
    if p.to_sym == name.downcase.to_sym &&
       p.parent == parent
      return p
    end
  end
  nil
end

#param_defined?(p) ⇒ Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns true if parameter p presents in list

Parameters:

Returns:

  • (Boolean)


420
421
422
# File 'lib/ass_launcher/enterprise/cli/parameters.rb', line 420

def param_defined?(p)
  !find(p.name, p.parent).nil?
end

#parametersObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Array of parameters. For add parameter into array use #<<



414
415
416
# File 'lib/ass_launcher/enterprise/cli/parameters.rb', line 414

def parameters
  @parameters ||= []
end

#usageObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Builds usage message



457
458
459
# File 'lib/ass_launcher/enterprise/cli/parameters.rb', line 457

def usage
  fail NotImplementedError
end