Module: Disposable::Twin::Setup

Included in:
Disposable::Twin
Defined in:
lib/disposable/twin/setup.rb

Overview

Read all properties at twin initialization time from model. Simply pass through all properties from the model to the respective twin writer method. This will result in all twin properties/collection items being twinned, and collections being Collection to expose the desired public API.

Defined Under Namespace

Modules: SkipSetter

Instance Method Summary collapse

Instance Method Details

#initialize(model, options = {}) ⇒ Object



8
9
10
11
12
13
14
# File 'lib/disposable/twin/setup.rb', line 8

def initialize(model, options={})
  @fields = {}
  @model  = model
  @mapper = mapper_for(model) # mapper for model.

  setup_properties!(options)
end