Class: AbstractMapper::Settings Private

Inherits:
Object
  • Object
show all
Defined in:
lib/abstract_mapper/settings.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

The configurable container of domain-specific DSL commands and rules along with corresponding AST builder and optimizer

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(rules = Rules.new, commands = Commands.new, &block) { ... } ⇒ Settings

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Initializes a domain-specific settings with commands and rules being set in the block.

Yields:

  • the block with settings for commands and rules



46
47
48
49
50
51
# File 'lib/abstract_mapper/settings.rb', line 46

def initialize(rules = Rules.new, commands = Commands.new, &block)
  @rules    = rules
  @commands = commands
  configure(&block)
  IceNine.deep_freeze(self)
end

Instance Attribute Details

#builderClass (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns The builder class with domain-specific commands.



37
38
39
# File 'lib/abstract_mapper/settings.rb', line 37

def builder
  @builder
end

#commandsAbstractMapper::Commands (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns The collection of registered DSL commands.



17
18
19
# File 'lib/abstract_mapper/settings.rb', line 17

def commands
  @commands
end

#optimizerAbstractMapper::Optimizer (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns The optimizer with domain-specific rules.



31
32
33
# File 'lib/abstract_mapper/settings.rb', line 31

def optimizer
  @optimizer
end

#rulesAbstractMapper::Rules (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns The collection of registered optimization rules.



24
25
26
# File 'lib/abstract_mapper/settings.rb', line 24

def rules
  @rules
end

Instance Method Details

#update { ... } ⇒ AbstractMapper::Settings

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new class with rules and commands added from the block to the existing ones

Yields:

  • the block with settings for commands and rules



60
61
62
# File 'lib/abstract_mapper/settings.rb', line 60

def update(&block)
  self.class.new(rules, commands, &block)
end