Class: NoSE::Serialize::UpdatePlanRepresenter

Inherits:
Representable::Decorator
  • Object
show all
Includes:
Representable::Hash, Representable::JSON, Representable::Uncached, Representable::YAML
Defined in:
lib/nose/serialize.rb

Overview

Represent an update plan

Instance Method Summary collapse

Methods included from Representable::Uncached

#representable_map

Instance Method Details

#cost_modelCost::Cost

The backend cost model used to cost the updates

Returns:



357
358
359
360
361
# File 'lib/nose/serialize.rb', line 357

def cost_model
  options = represented.cost_model.instance_variable_get(:@options)
  options[:name] = represented.cost_model.subtype_name
  options
end

#cost_model=(options) ⇒ void

This method returns an undefined value.

Look up the cost model by name and attach to the results



365
366
367
368
369
# File 'lib/nose/serialize.rb', line 365

def cost_model=(options)
  options = options.deep_symbolize_keys
  cost_model_class = Cost::Cost.subtype_class(options[:name])
  represented.cost_model = cost_model_class.new(**options)
end