module AbstractMapper::DSL

Provides features to configure mappers

@api private

Attributes

settings[R]

@!attribute [r] settings

@return [AbstractMapper::Settings]

The configurable container of domain-specific settings
(DSL commands and optimization rules along with corresponding
AST builder and optimizer).

Public Instance Methods

configure(&block) click to toggle source

Configures domain-specific settings

@param [Proc] block The block where rules and commands to be registered

@return [self] itself

@yield a block

# File lib/abstract_mapper/dsl.rb, line 33
def configure(&block)
  @settings = settings ? settings.update(&block) : Settings.new(&block)
  self
end
finalize() click to toggle source

Returns the optimized AST

@return [AbstractMapper::Branch]

# File lib/abstract_mapper/dsl.rb, line 42
def finalize
  settings.optimizer.update(tree)
end
inherited(klass) click to toggle source

@private

# File lib/abstract_mapper/dsl.rb, line 12
def inherited(klass)
  klass.instance_variable_set :@settings, settings
end