Class: Oyster::FlagOption

Inherits:
Option
  • Object
show all
Defined in:
lib/oyster/options/flag.rb

Instance Method Summary collapse

Methods inherited from Option

#alternate, create, #has_name?, #initialize, #name

Constructor Details

This class inherits a constructor from Oyster::Option

Instance Method Details

#consume(list) ⇒ Object



4
5
# File 'lib/oyster/options/flag.rb', line 4

def consume(list)
end

#default_valueObject



7
8
9
# File 'lib/oyster/options/flag.rb', line 7

def default_value
  super(false)
end

#descriptionObject



17
18
19
# File 'lib/oyster/options/flag.rb', line 17

def description
  super + (default_value ? ' (This is the default)' : '')
end

#help_namesObject



11
12
13
14
15
# File 'lib/oyster/options/flag.rb', line 11

def help_names
  default_value ?
      super.map { |name| name.sub(/^--/, '--[no-]') } :
      super
end