Class: AbstractMapper::Settings Private
- Inherits:
-
Object
- Object
- AbstractMapper::Settings
- 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
-
#builder ⇒ Class
readonly
private
The builder class with domain-specific commands.
-
#commands ⇒ AbstractMapper::Commands
readonly
private
The collection of registered DSL commands.
-
#optimizer ⇒ AbstractMapper::Optimizer
readonly
private
The optimizer with domain-specific rules.
-
#rules ⇒ AbstractMapper::Rules
readonly
private
The collection of registered optimization rules.
Instance Method Summary collapse
-
#initialize(rules = Rules.new, commands = Commands.new, &block) { ... } ⇒ Settings
constructor
private
Initializes a domain-specific settings with commands and rules being set in the block.
-
#update { ... } ⇒ AbstractMapper::Settings
private
Returns a new class with rules and commands added from the block to the existing ones.
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.
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
#builder ⇒ Class (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 |
#commands ⇒ AbstractMapper::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 |
#optimizer ⇒ AbstractMapper::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 |
#rules ⇒ AbstractMapper::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
60 61 62 |
# File 'lib/abstract_mapper/settings.rb', line 60 def update(&block) self.class.new(rules, commands, &block) end |