Module: Origen::SubBlocks::Parent

Included in:
Origen::SubBlocks
Defined in:
lib/origen/sub_blocks.rb

Overview

Jumping through some hoops here since many Origen modules talk about an owner, but would prefer to start standardizing on parent in future, so this should give most Origen models a parent method

Instance Method Summary collapse

Instance Method Details

#owner=(obj) ⇒ Object Also known as: parent=



76
77
78
79
80
81
82
# File 'lib/origen/sub_blocks.rb', line 76

def owner=(obj)
  if obj.respond_to?(:controller) && obj.controller
    @owner = obj.controller
  else
    @owner = obj
  end
end

#parentObject Also known as: owner



70
71
72
# File 'lib/origen/sub_blocks.rb', line 70

def parent
  @owner
end