Class: MR::Factory::ModelStack

Inherits:
Object
  • Object
show all
Defined in:
lib/mr/factory/model_stack.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(model, factory_config) ⇒ ModelStack

Returns a new instance of ModelStack.



11
12
13
14
# File 'lib/mr/factory/model_stack.rb', line 11

def initialize(model, factory_config)
  @model        = model
  @record_stack = MR::Factory::RecordStack.for_record(model.record, factory_config)
end

Instance Attribute Details

#modelObject (readonly)

Returns the value of attribute model.



9
10
11
# File 'lib/mr/factory/model_stack.rb', line 9

def model
  @model
end

Instance Method Details

#createObject



18
# File 'lib/mr/factory/model_stack.rb', line 18

def create;  @record_stack.create;  end

#create_dependenciesObject Also known as: create_deps



21
# File 'lib/mr/factory/model_stack.rb', line 21

def create_dependencies; @record_stack.create_dependencies; end

#destroyObject



19
# File 'lib/mr/factory/model_stack.rb', line 19

def destroy; @record_stack.destroy; end

#destroy_dependenciesObject Also known as: destroy_deps



24
# File 'lib/mr/factory/model_stack.rb', line 24

def destroy_dependencies; @record_stack.destroy_dependencies; end

#factory_configObject



16
# File 'lib/mr/factory/model_stack.rb', line 16

def factory_config; @record_stack.factory_config; end