Class Slop::Option
In: lib/slop/option.rb
Parent: Object

Methods

Constants

DEFAULT_OPTIONS = { :argument => false, :optional_argument => false, :tail => false, :default => nil, :callback => nil, :delimiter => ',', :limit => 0, :match => nil, :optional => true, :required => false, :as => String, :autocreated => false   The default Hash of configuration options this class uses.

Attributes

config  [R] 
count  [RW] 
description  [R] 
long  [R] 
short  [R] 
types  [R] 
value  [W] 

Public Class methods

Incapsulate internal option information, mainly used to store option specific configuration data, most of the meat of this class is found in the value method.

slop - The instance of Slop tied to this Option. short - The String or Symbol short flag. long - The String or Symbol long flag. description - The String description text. config - A Hash of configuration options. block - An optional block used as a callback.

Public Instance methods

Returns true if this option accepts an optional argument.

Call this options callback if one exists, and it responds to call().

Returns nothing.

Returns true if this option expects an argument.

help()

Alias for to_s

Returns the String inspection text.

Returns the String flag of this option. Preferring the long flag.

Returns the help String for this option.

Fetch the argument value for this option.

Returns the Object once any type conversions have taken place.

[Validate]