Sha256: f12c94e33d2d8eb2cd9605a941f2553a86eb7008f997acbe814b09591fcd6134

Contents?: true

Size: 781 Bytes

Versions: 30

Compression:

Stored size: 781 Bytes

Contents

NAME
  options.rb

DESCRIPTION
  options.rb simplifies the common idiom of dealing with keyword options in
  ruby functions.  it also deals correctly with symbol vs string keywords and
  prevents many subtle programming errors that can arise from doing so
  incorrectly.  options.rb doesn't hack ruby's core with one exception: the
  method Array#options.

SYNOPSIS
  require 'options'

  def method(*args, &block)
    args, options = Options.parse(args)

    a = args.shift
    b = args.shift

    force = options.getopt(:force, default = false)
    verbose = options.getopt([:verbose, :VERBOSE])
    foo, bar = options.getopt(:foo, :bar)
  end

INSTALL
  gem install options

HISTORY
  2.1.0:
    - 1.9 compatibility
    - Validation of passed options

SAMPLES

  <%= samples %>

Version data entries

30 entries across 30 versions & 3 rubygems

Version Path
ahoward-options-2.1.1 README.erb
options-2.3.2 README.erb
options-2.3.1 README.erb
abiquo-etk-0.6.4 vendor/options-2.3.0/README.erb
abiquo-etk-0.6.3 vendor/options-2.3.0/README.erb
abiquo-etk-0.6.2 vendor/options-2.3.0/README.erb
abiquo-etk-0.6.1 vendor/options-2.3.0/README.erb
abiquo-etk-0.6.0 vendor/options-2.3.0/README.erb
abiquo-etk-0.5.9 vendor/options-2.3.0/README.erb
abiquo-etk-0.5.8 vendor/options-2.3.0/README.erb
abiquo-etk-0.5.3 vendor/options-2.3.0/README.erb
abiquo-etk-0.4.42 vendor/options-2.3.0/README.erb
abiquo-etk-0.4.33 vendor/options-2.3.0/README.erb
abiquo-etk-0.4.32 vendor/options-2.3.0/README.erb
abiquo-etk-0.4.29 vendor/options-2.3.0/README.erb
abiquo-etk-0.4.25 vendor/options-2.3.0/README.erb
abiquo-etk-0.4.24 vendor/options-2.3.0/README.erb
abiquo-etk-0.4.23 vendor/options-2.3.0/README.erb
abiquo-etk-0.4.22 vendor/options-2.3.0/README.erb
abiquo-etk-0.4.20 vendor/options-2.3.0/README.erb