module OptionalArgument

Constants

VERSION

Public Class Methods

define(&block) click to toggle source

@yieldreturn [Class] subclass of Store @return [void] must block given

# File lib/optionalargument/singleton_class.rb, line 8
def define(&block)
  raise ArgumentError, 'block was not given' unless block

  Class.new(Store) {
    _init
    class_eval(&block)
    _fix
  }
end
parse(opts, **kwargs, &block) click to toggle source

@see OptionalArgument::Store.parse

# File lib/optionalargument/singleton_class.rb, line 19
def parse(opts, **kwargs, &block)
  raise ArgumentError, 'block was not given' unless block

  define(&block).parse(opts, **kwargs)
end