Class: AssLauncher::Cmd::Abstract::Cli::Report::Row Private

Inherits:
Object
  • Object
show all
Includes:
Support::AcceptedValuesGet
Defined in:
lib/ass_launcher/cmd.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.

Report’s row

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Support::AcceptedValuesGet

#accepted_values_get, #xxx_list_keys

Constructor Details

#initialize(param) ⇒ Row

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 Row.



548
549
550
551
# File 'lib/ass_launcher/cmd.rb', line 548

def initialize(param)
  @param = param
  fill
end

Instance Attribute Details

#paramObject (readonly)

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.



547
548
549
# File 'lib/ass_launcher/cmd.rb', line 547

def param
  @param
end

Instance Method Details

#basic_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.

rubocop:enable Metrics/AbcSize, Metrics/CyclomaticComplexity rubocop:enable Metrics/MethodLength



585
586
587
588
# File 'lib/ass_launcher/cmd.rb', line 585

def basic_usage
  return "  #{param.name}" if param.parent
  param.name
end

#dsl_method_getObject

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.



590
591
592
593
594
# File 'lib/ass_launcher/cmd.rb', line 590

def dsl_method_get
  method = param.name.gsub(%r{^\s*(/|-)}, '_')
  return "  #{method}" if param.parent
  method
end

#to_csv(columns) ⇒ 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.



596
597
598
599
600
601
602
# File 'lib/ass_launcher/cmd.rb', line 596

def to_csv(columns)
  r = ''
  columns.each do |col|
    r << "\"#{send(col).to_s.tr('"', '\'')}\";"
  end
  r.gsub(/;$/, '')
end

#usage_fullObject

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.



569
570
571
572
573
574
575
576
577
578
579
580
581
# File 'lib/ass_launcher/cmd.rb', line 569

def usage_full
  case param.class.name.split('::').last
  when 'Switch' then
    ["#{basic_usage}(#{accepted_values_get.join('|')})"]
  when 'Chose' then
    [basic_usage, accepted_values_get.join(', ')]
  when 'StringParam' then [basic_usage, 'VALUE']
  when 'Path' then [basic_usage, 'PATH']
  when 'Flag' then [basic_usage]
  when 'PathTwice' then [basic_usage, 'PATH PATH']
  else basic_usage
  end
end