Class: Musa::Darwin::Darwin::MainContext
- Inherits:
-
Object
- Object
- Musa::Darwin::Darwin::MainContext
- Includes:
- Extension::With
- Defined in:
- lib/musa-dsl/generative/darwin.rb
Instance Attribute Summary collapse
-
#_measures ⇒ Object
readonly
Returns the value of attribute _measures.
-
#_weights ⇒ Object
readonly
Returns the value of attribute _weights.
Instance Method Summary collapse
-
#initialize(&block) ⇒ MainContext
constructor
A new instance of MainContext.
- #measures(&block) ⇒ Object
- #weight(**feature_or_dimension_weights) ⇒ Object
Methods included from Extension::With
Constructor Details
#initialize(&block) ⇒ MainContext
Returns a new instance of MainContext.
69 70 71 72 |
# File 'lib/musa-dsl/generative/darwin.rb', line 69 def initialize(&block) @_weights = {} with &block end |
Instance Attribute Details
#_measures ⇒ Object (readonly)
Returns the value of attribute _measures.
67 68 69 |
# File 'lib/musa-dsl/generative/darwin.rb', line 67 def _measures @_measures end |
#_weights ⇒ Object (readonly)
Returns the value of attribute _weights.
67 68 69 |
# File 'lib/musa-dsl/generative/darwin.rb', line 67 def _weights @_weights end |
Instance Method Details
#measures(&block) ⇒ Object
74 75 76 |
# File 'lib/musa-dsl/generative/darwin.rb', line 74 def measures(&block) @_measures = block end |
#weight(**feature_or_dimension_weights) ⇒ Object
78 79 80 81 82 |
# File 'lib/musa-dsl/generative/darwin.rb', line 78 def weight(**feature_or_dimension_weights) feature_or_dimension_weights.each do |name, value| @_weights[name] = value end end |