Module: Disposable::Twin::Property::Unnest
- Included in:
- Disposable::Twin
- Defined in:
- lib/disposable/twin/property/unnest.rb
Class Method Summary collapse
-
.included(includer) ⇒ Object
TODO: test that nested properties options are “unnested”, too, e.g.
Instance Method Summary collapse
Class Method Details
.included(includer) ⇒ Object
TODO: test that nested properties options are “unnested”, too, e.g. populator.
6 7 8 |
# File 'lib/disposable/twin/property/unnest.rb', line 6 def self.included(includer) includer.send(:include, Uber::Delegates) end |
Instance Method Details
#unnest(name, options) ⇒ Object
10 11 12 13 14 15 16 17 18 19 |
# File 'lib/disposable/twin/property/unnest.rb', line 10 def unnest(name, ) from = .delete(:from) # needed to make reform process this field. = definitions.get(from)[:nested].definitions.get(name).instance_variable_get(:@options) # FIXME. = .merge(virtual: true, _inherited: true, private_name: nil) property(name, ) delegates from, name, "#{name}=" end |