module Toys::FlagGroup
def self.create(type: nil, name: nil, desc: nil, long_desc: nil)
- 
        (Toys::FlagGroup::Base)- A flag group of the correct subclass.
Parameters:
- 
        name(String, Symbol, nil) -- The name of the group, or nil for no
- 
        long_desc(Array) --,Toys::WrappableString> 
- 
        desc(String, Array) -- Short, Toys::WrappableString 
- 
        type(Symbol) -- The type of group. Default is `:optional`.
def self.create(type: nil, name: nil, desc: nil, long_desc: nil) type ||= Optional unless type.is_a?(::Class) class_name = ModuleLookup.to_module_name(type) type = begin FlagGroup.const_get(class_name) rescue ::NameError raise ToolDefinitionError, "Unknown flag group type: #{type}" end end unless type.ancestors.include?(Base) raise ToolDefinitionError, "Unknown flag group type: #{type}" end type.new(name, desc, long_desc) end