Class: Musa::Darwin::Darwin::MainContext Private
- Includes:
- Extension::With
- Defined in:
- lib/musa-dsl/generative/darwin.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.
DSL context for Darwin configuration.
Instance Attribute Summary collapse
- #_measures ⇒ Proc, Hash readonly private
- #_weights ⇒ Proc, Hash readonly private
Instance Method Summary collapse
-
#initialize(&block) ⇒ MainContext
constructor
private
A new instance of MainContext.
-
#measures {|object| ... } ⇒ Object
private
Defines measures evaluation block.
-
#weight(**feature_or_dimension_weights) ⇒ Object
private
Assigns weights to features/dimensions.
-
#with(*value_parameters, keep_block_context: nil, **key_parameters, &block) ⇒ Object
included
from Extension::With
Executes a block with flexible context and parameter handling.
Constructor Details
#initialize(&block) ⇒ MainContext
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 instance of MainContext.
193 194 195 196 |
# File 'lib/musa-dsl/generative/darwin.rb', line 193 def initialize(&block) @_weights = {} with &block end |
Instance Attribute Details
#_measures ⇒ Proc, Hash (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.
190 191 192 |
# File 'lib/musa-dsl/generative/darwin.rb', line 190 def _measures @_measures end |
#_weights ⇒ Proc, Hash (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.
190 191 192 |
# File 'lib/musa-dsl/generative/darwin.rb', line 190 def _weights @_weights end |
Instance Method Details
#measures {|object| ... } ⇒ Object
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.
Defines measures evaluation block.
202 203 204 |
# File 'lib/musa-dsl/generative/darwin.rb', line 202 def measures(&block) @_measures = block end |
#weight(**feature_or_dimension_weights) ⇒ Object
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.
Assigns weights to features/dimensions.
210 211 212 213 214 |
# File 'lib/musa-dsl/generative/darwin.rb', line 210 def weight(**feature_or_dimension_weights) feature_or_dimension_weights.each do |name, value| @_weights[name] = value end end |
#with(*value_parameters, keep_block_context: nil, **key_parameters, &block) ⇒ Object Originally defined in module Extension::With
The _ parameter is special: when present, it signals "keep caller's context"
and receives self (the object) as its value.
Uses SmartProcBinder internally to handle parameter matching.
Executes a block with flexible context and parameter handling.