Module: DslOrganizer::Core

Included in:
DslOrganizer
Defined in:
lib/dsl_organizer/core.rb

Overview

Load methods for control dsl commands.

Instance Method Summary collapse

Instance Method Details

#dictionary(commands: []) ⇒ Module

Examples:

commands: { after: AfterHook, before: BeforeHook }

Returns:

  • (Module)


9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/dsl_organizer/core.rb', line 9

def dictionary(commands: [])
  CommandContainer.reset

  @dsl_commands = commands
  validate_commands

  dsl_module = new_dsl_module(dsl_operator: new_dsl_operator)
  Module.new do
    singleton_class.send :define_method, :included do |host_class|
      host_class.extend dsl_module
    end
  end
end