Class: EacCli::Runner::BaseOption

Inherits:
Object
  • Object
show all
Defined in:
lib/eac_cli/runner/base_option.rb

Direct Known Subclasses

ArgumentOption, BooleanOption

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(short, long, description, options = {}) ⇒ BaseOption

Returns a new instance of BaseOption.



10
11
12
13
14
15
# File 'lib/eac_cli/runner/base_option.rb', line 10

def initialize(short, long, description, options = {})
  @short = short
  @long = long
  @description = description
  @options = options.with_indifferent_access
end

Instance Attribute Details

#descriptionObject (readonly)

Returns the value of attribute description.



8
9
10
# File 'lib/eac_cli/runner/base_option.rb', line 8

def description
  @description
end

#longObject (readonly)

Returns the value of attribute long.



8
9
10
# File 'lib/eac_cli/runner/base_option.rb', line 8

def long
  @long
end

#optionsObject (readonly)

Returns the value of attribute options.



8
9
10
# File 'lib/eac_cli/runner/base_option.rb', line 8

def options
  @options
end

#shortObject (readonly)

Returns the value of attribute short.



8
9
10
# File 'lib/eac_cli/runner/base_option.rb', line 8

def short
  @short
end

Instance Method Details

#show_on_usage?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/eac_cli/runner/base_option.rb', line 17

def show_on_usage?
  options[:usage]
end