Class Commander::Command::Options
In: lib/commander/command.rb
Parent: Object

Options struct.

Methods

__hash__   default   inspect   method_missing   new  

Included Modules

Blank

Public Class methods

[Source]

    # File lib/commander/command.rb, line 16
16:       def initialize
17:         @table = {}
18:       end

Public Instance methods

[Source]

    # File lib/commander/command.rb, line 20
20:       def __hash__
21:         @table
22:       end

[Source]

    # File lib/commander/command.rb, line 28
28:       def default defaults = {}
29:         @table = defaults.merge! @table
30:       end

[Source]

    # File lib/commander/command.rb, line 32
32:       def inspect
33:         "<Commander::Command::Options #{ __hash__.map { |k,v| "#{k}=#{v.inspect}" }.join(', ') }>"
34:       end

[Source]

    # File lib/commander/command.rb, line 24
24:       def method_missing meth, *args, &block
25:         meth.to_s =~ /=$/ ? @table[meth.to_s.chop.to_sym] = args.first : @table[meth]
26:       end

[Validate]