Class: Musa::Darwin::Darwin::MainContext

Inherits:
Object
  • Object
show all
Includes:
Extension::With
Defined in:
lib/musa-dsl/generative/darwin.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Extension::With

#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

#_measuresObject (readonly)

Returns the value of attribute _measures.



67
68
69
# File 'lib/musa-dsl/generative/darwin.rb', line 67

def _measures
  @_measures
end

#_weightsObject (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