Class: GetoptLong
Overview
GetoptLong
Ruby’s standard GetoptLong class with an added DSL.
opts = GetoptLong.new do
reqs '--expect', '-x'
flag '--help', '-h'
end
See GetoptLong::DSL for details.
Defined Under Namespace
Classes: DSL
Instance Method Summary collapse
- #init ⇒ Object
-
#initialize(*arguments, &block) ⇒ GetoptLong
constructor
A new instance of GetoptLong.
Constructor Details
#initialize(*arguments, &block) ⇒ GetoptLong
Returns a new instance of GetoptLong.
19 20 21 22 23 24 25 |
# File 'lib/standard/facets/getoptlong.rb', line 19 def initialize(*arguments, &block) if block_given? raise ArgumentError unless arguments.empty? arguments = DSL.new(&block).arguments end init(*arguments) end |
Instance Method Details
#init ⇒ Object
16 |
# File 'lib/standard/facets/getoptlong.rb', line 16 alias :init :initialize |