Class: Twat::Args

Inherits:
Object
  • Object
show all
Defined in:
lib/twat/argparse.rb

Instance Method Summary collapse

Constructor Details

#initializeArgs

TODO delegate specifically instead of shimming everything? TODO Twat::Subcommands.COMMANDS needs to be parsed and dumped



16
17
18
19
# File 'lib/twat/argparse.rb', line 16

def initialize
  # XXX What the shit...
  getopts
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(sym) ⇒ Object



21
22
23
# File 'lib/twat/argparse.rb', line 21

def method_missing(sym)
  @options[sym]
end

Instance Method Details

#[](key) ⇒ Object



25
26
27
# File 'lib/twat/argparse.rb', line 25

def [](key)
  @options[key]
end

#include?(key) ⇒ Boolean

Returns:

  • (Boolean)


29
30
31
# File 'lib/twat/argparse.rb', line 29

def include?(key)
  @options.include?(key)
end