Class Mercenary::Option
In: lib/mercenary/option.rb
Parent: Object

Methods

Attributes

config_key  [R] 
description  [R] 
long  [R] 
return_type  [R] 
short  [R] 

Public Class methods

Public: Create a new Option

config_key - the key in the config hash to which the value of this option

             will map

info - an array containing first the switches, then an optional

             return type (e.g. Array), then a description of the option

Returns nothing

Public Instance methods

Public: Check equivalence of two Options based on equivalence of their

  instance variables

Returns true if all the instance variables are equal, false otherwise

Public: Fetch the array containing the info OptionParser is interested in

Returns the array which OptionParser#on wants

Public: Build a beautifully-formatted string representation of the switches

Returns a formatted string representation of the switches

Public: Hash based on the hash value of instance variables

Returns a Fixnum which is unique to this Option based on the instance variables

Public: Fetch an array of switches, including the short and long versions

Returns an array of two strings. An empty string represents no switch in that position.

Public: Build a string representation of this option including the

  switches and description

Returns a string representation of this option

[Validate]