Class: ROM::ConfigurationDSL::CommandDSL
- Inherits:
-
Object
- Object
- ROM::ConfigurationDSL::CommandDSL
- Defined in:
- core/lib/rom/configuration_dsl/command_dsl.rb
Overview
Command define
DSL used by Setup#commands
Instance Attribute Summary collapse
- #adapter ⇒ Object readonly
- #command_classes ⇒ Object readonly
- #relation ⇒ Object readonly
Instance Method Summary collapse
-
#define(name, options = EMPTY_HASH, &block) ⇒ Class
Define a command class.
Instance Attribute Details
#adapter ⇒ Object (readonly)
11 12 13 |
# File 'core/lib/rom/configuration_dsl/command_dsl.rb', line 11 def adapter @adapter end |
#command_classes ⇒ Object (readonly)
11 12 13 |
# File 'core/lib/rom/configuration_dsl/command_dsl.rb', line 11 def command_classes @command_classes end |
#relation ⇒ Object (readonly)
11 12 13 |
# File 'core/lib/rom/configuration_dsl/command_dsl.rb', line 11 def relation @relation end |
Instance Method Details
#define(name, options = EMPTY_HASH, &block) ⇒ Class
Define a command class
30 31 32 33 34 |
# File 'core/lib/rom/configuration_dsl/command_dsl.rb', line 30 def define(name, = EMPTY_HASH, &block) @command_classes << Command.build_class( name, relation, { adapter: adapter }.merge(), &block ) end |