Module: Candy::Embeddable
- Included in:
- CandyArray, Piece
- Defined in:
- lib/candy/embeddable.rb
Overview
Shared methods to create associations between top-level objects and embedded objects (hashes, arrays, or Candy::Pieces).
Instance Method Summary collapse
-
#candy_adopt(parent, attribute) ⇒ Object
Tells an embedded object about its parent.
Instance Method Details
#candy_adopt(parent, attribute) ⇒ Object
Tells an embedded object about its parent. When its own state changes, it can use this information to write home and update the parent.
9 10 11 12 13 |
# File 'lib/candy/embeddable.rb', line 9 def candy_adopt(parent, attribute) @__candy_parent = parent @__candy_parent_key = attribute self end |