Class: CSVPlusPlus::CLIFlag

Inherits:
Object
  • Object
show all
Extended by:
T::Sig
Defined in:
lib/csv_plus_plus/cli_flag.rb

Overview

Individual CLI flags that a user can supply

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(short_flag, long_flag, description) ⇒ CLIFlag

Returns a new instance of CLIFlag.

Parameters:

  • short_flag (String)

    A definition of the short/single-character flag

  • long_flag (String)

    A definition of the long/word-based flag

  • description (String)

    A description of what the flag does



27
28
29
30
31
# File 'lib/csv_plus_plus/cli_flag.rb', line 27

def initialize(short_flag, long_flag, description)
  @short_flag = short_flag
  @long_flag = long_flag
  @description = description
end

Instance Attribute Details

#descriptionString (readonly)

A description of what the flag does

Returns:

  • (String)

    the current value of description



11
12
13
# File 'lib/csv_plus_plus/cli_flag.rb', line 11

def description
  @description
end

#handlerProc(Options, String) (readonly)

A proc which is called to handle when this flag is seen

Returns:

  • (Proc(Options, String))

    the current value of handler



11
12
13
# File 'lib/csv_plus_plus/cli_flag.rb', line 11

def handler
  @handler
end

#long_flagString (readonly)

A definition of the long/word-based flag

Returns:

  • (String)

    the current value of long_flag



11
12
13
# File 'lib/csv_plus_plus/cli_flag.rb', line 11

def long_flag
  @long_flag
end

#short_flagString (readonly)

A definition of the short/single-character flag

Returns:

  • (String)

    the current value of short_flag



11
12
13
# File 'lib/csv_plus_plus/cli_flag.rb', line 11

def short_flag
  @short_flag
end