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) ⇒ void constructor private
-
#measures {|object| ... } ⇒ Proc
private
Defines measures evaluation block.
-
#weight(**feature_or_dimension_weights) ⇒ void
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) ⇒ void
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.
211 212 213 214 |
# File 'lib/musa-dsl/generative/darwin.rb', line 211 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.
207 208 209 |
# File 'lib/musa-dsl/generative/darwin.rb', line 207 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.
207 208 209 |
# File 'lib/musa-dsl/generative/darwin.rb', line 207 def _weights @_weights end |
Instance Method Details
#measures {|object| ... } ⇒ Proc
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.
223 224 225 |
# File 'lib/musa-dsl/generative/darwin.rb', line 223 def measures(&block) @_measures = block end |
#weight(**feature_or_dimension_weights) ⇒ void
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.
This method returns an undefined value.
Assigns weights to features/dimensions.
234 235 236 237 238 |
# File 'lib/musa-dsl/generative/darwin.rb', line 234 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.