Class: AssLauncher::Enterprise::Cli::Parameters::AllParameters 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 all versions

Raises:

  • (ArgumentError)

    if parameter p.name alrady defined for version

Instance Method Summary collapse

Instance Method Details

#add(p, version) ⇒ 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.

Add parameter into list

Parameters:

Raises:

  • (ArgumentError)

    if parameter p.name alrady defined for version



475
476
477
478
# File 'lib/ass_launcher/enterprise/cli/parameters.rb', line 475

def add(p, version)
  fail_if_difined(p, version)
  parameters << p
end

#find(name, parent) ⇒ Array

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 all parameter versions

Parameters:

  • name (String)

    name of parameter like defined 1C cli api

  • parent

    kinde of StringParam parent for subpurameter

Returns:

  • (Array)

    of parameters



536
537
538
539
540
541
# File 'lib/ass_launcher/enterprise/cli/parameters.rb', line 536

def find(name, parent)
  parameters.select do |p|
    p.to_sym == name.downcase.to_sym &&
      p.parent == parent
  end
end

#find_for_version(name, parent, version) ⇒ 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.

Find actual parameter for version

Parameters:

  • version (Gem::Version)
  • name (String)

    name of parameter like defined 1C cli api

  • parent

    kinde of StringParam parent for subpurameter

Returns:



518
519
520
521
522
523
524
# File 'lib/ass_launcher/enterprise/cli/parameters.rb', line 518

def find_for_version(name, parent, version)
  r = nil
  find(name, parent).each do |p|
    r = oops!(r, p, version) if p.match_version? version
  end
  r
end

#param_defined?(p, version) ⇒ 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 for version presents in list

Parameters:

Returns:

  • (Boolean)


490
491
492
493
494
495
# File 'lib/ass_launcher/enterprise/cli/parameters.rb', line 490

def param_defined?(p, version)
  find(p.name, p.parent).each do |p_|
    return true if p_.match_version? version
  end
  false
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 #add



467
468
469
# File 'lib/ass_launcher/enterprise/cli/parameters.rb', line 467

def parameters
  @parameters ||= []
end

#to_parameters_list(binary_wrapper, run_mode) ⇒ ParametersList

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.

Return parameters list for given binary_wrapper and run_mode

Parameters:

Returns:



500
501
502
503
504
505
506
# File 'lib/ass_launcher/enterprise/cli/parameters.rb', line 500

def to_parameters_list(binary_wrapper, run_mode)
  r = new_list
  parameters.each do |p|
    r << p if p.match? binary_wrapper, run_mode
  end
  r
end