core/lib/rom/commands/class_interface.rb
# Create a command class with a specific type
#
# @param [Symbol] name Command name
# @param [Class] type Command class
#
# @yield [Class]
#
# @return [Class, Object]
#
# @api public
Create a command class with a specific type
Create a command class with a specific type
def create_class(name, type, &block)
        klass = Dry::Core::ClassBuilder
          .new(name: "#{Inflector.classify(type)}[:#{name}]", parent: type)
          .call
        if block
          yield(klass)
        else
          klass
        end
      end
def create_class ( name , type , & block ) klass = Dry :: Core :: ClassBuilder . new ( name : "#{Inflector.classify(type)}[:#{name}]" , parent : type ) . call if block yield ( klass ) else klass end end
Create a command class with a specific type
Create a command class with a specific type
None
Class, Object
name
<not_specific>
type
<not_specific>
block
<not_specific>
<not_specific>
type Command class
type Command class
]
<not_specific>
None
api
None