Module: Moon::RenderPrimitive::Containable

Included in:
Moon::RenderContext
Defined in:
lib/moon/packages/render_primitives/containable.rb

Overview

Mixin for containerizing RenderContext objects in a RenderContainer

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#parentMoon::RenderPrimitive::Containable


7
8
9
# File 'lib/moon/packages/render_primitives/containable.rb', line 7

def parent
  @parent
end

Instance Method Details

#containerizeMoon::RenderContainer

Wrap this into a RenderContainer


19
20
21
22
23
# File 'lib/moon/packages/render_primitives/containable.rb', line 19

def containerize
  container = RenderContainer.new
  container.add self
  container
end

#disownVoid

Parent containers call this method to invalidate their children

Returns:

  • (Void)

12
13
14
# File 'lib/moon/packages/render_primitives/containable.rb', line 12

def disown
  self.parent = nil
end