Sha256: 1bc7b216436acc177d68c7f9187f84da815137a14f4291eab315201e82b0a84c
Contents?: true
Size: 891 Bytes
Versions: 38
Compression:
Stored size: 891 Bytes
Contents
require 'rom/configuration_dsl/command' module ROM module ConfigurationDSL # Command `define` DSL used by Setup#commands # # @private class CommandDSL attr_reader :relation, :adapter, :command_classes # @api private def initialize(relation, adapter = nil, &block) @relation = relation @adapter = adapter @command_classes = [] instance_exec(&block) end # Define a command class # # @param [Symbol] name of the command # @param [Hash] options # @option options [Symbol] :type The type of the command # # @return [Class] generated class # # @api public def define(name, options = EMPTY_HASH, &block) @command_classes << Command.build_class( name, relation, { adapter: adapter }.merge(options), &block ) end end end end
Version data entries
38 entries across 38 versions & 2 rubygems