Class: AssLauncher::Enterprise::Cli::Parameters::StringParam Private

Inherits:
Object
  • Object
show all
Includes:
AssLauncher::Enterprise::Cli::Parameters
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.

Parameter expects string value

Direct Known Subclasses

Chose, Flag, Path, PathTwice, Skip, Switch

Constant Summary

Constants included from AssLauncher::Enterprise::Cli::Parameters

DEFAULT_OPTIONS

Instance Attribute Summary

Attributes included from AssLauncher::Enterprise::Cli::Parameters

#binary_matcher, #desc, #group, #modes, #name, #options, #parent

Instance Method Summary collapse

Methods included from AssLauncher::Enterprise::Cli::Parameters

#add_child, #child?, #childs, #chose_list, #deep, #full_name, #match?, #match_version?, #parents, #required?, #restrict_from, #root?, #switch_list, #switch_value, #to_args, #to_s, #to_sym, #usage, #value_validator

Constructor Details

#initialize(name, desc, binary_matcher, group, modes, parent = nil, **options) ⇒ StringParam

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 a new instance of StringParam.

Parameters:

  • name (String)

    name of parameter like defined 1C cli api

  • desc (String)

    help description

  • binary_matcher (BinaryMatcher, String, nil)

    for which parameter defined

    • If nil will be build default matcher.

    • If string. String value must be suitable for Gem::Requirement. In this case, will be build matcher for version defined in string and suitable bynary type detected on run_modes

  • group (Symbol)

    parameter group

  • modes (Array)

    run modes for which parameter defined

  • parent (defaults to: nil)
  • options (Hash)


226
227
228
229
230
231
232
233
234
235
236
# File 'lib/ass_launcher/enterprise/cli/parameters.rb', line 226

def initialize(name, desc, binary_matcher,
               group, modes, parent = nil, **options)
  @name = name
  @desc = desc
  @modes = modes || Cli::DEFINED_MODES
  @binary_matcher = auto_binary_matcher(binary_matcher)
  @group = group
  @options = def_options.merge options
  @parent = parent
  @parent.add_child(self) unless parent.nil?
end

Instance Method Details

#argument_requireObject

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.

Parameter require argumet



239
240
241
# File 'lib/ass_launcher/enterprise/cli/parameters.rb', line 239

def argument_require
  arguments_count > 0
end

#arguments_countObject

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.

Count of parameter argumets



244
245
246
# File 'lib/ass_launcher/enterprise/cli/parameters.rb', line 244

def arguments_count
  1
end