Sha256: effe5a79589af0a9e5bb64dde17987ca432f10f9c6761af1f6b7ffb08729f871
Contents?: true
Size: 444 Bytes
Versions: 1
Compression:
Stored size: 444 Bytes
Contents
module OptParseBuilder class ArgumentBundle < Argument # :nodoc: def initialize @arguments = [] end def <<(argument) @arguments << argument end def to_a @arguments.reduce([]) do |a, arg| a + arg.to_a end end def simplify case @arguments.count when 0 NullArgument.new when 1 @arguments.first else self end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
opt_parse_builder-0.1.0 | lib/opt_parse_builder/argument_bundle.rb |