Module: Campo::Childish

Included in:
Base
Defined in:
lib/campo/campo.rb

Overview

Deals with adding children and tracking parents.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#parentObject

Returns the value of attribute parent.



20
21
22
# File 'lib/campo/campo.rb', line 20

def parent
  @parent
end

Instance Method Details

#push=(child) ⇒ Object Also known as: <<

Push something onto the end of the fields array.

Parameters:

  • child (Object)

    The object to push.

Returns:

  • (Object)

    self



11
12
13
14
15
# File 'lib/campo/campo.rb', line 11

def push=( child )
  @fields << child
  child.parent = self
  self
end