Sha256: 08a5e5996b5d31ea4bdcf03e592c426776ad1e5917d48130d732380181be1028

Contents?: true

Size: 303 Bytes

Versions: 3

Compression:

Stored size: 303 Bytes

Contents

require 'options'

# options.rb makes is super easy to deal with keyword options in a safe and
# easy way.
#

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

    force = options.getopt(:force, default=false)
    p force
  end

  method(:foo, :bar, :force => true)
  method('force' => true)

Version data entries

3 entries across 3 versions & 2 rubygems

Version Path
ahoward-options-2.0.0 samples/a.rb
options-2.0.0 samples/a.rb
options-1.0.0 samples/a.rb