class PMP::Links

Attributes

parent[RW]

Public Class Methods

new(parent) click to toggle source
Calls superclass method
# File lib/pmp/links.rb, line 10
def initialize(parent)
  super()
  self.parent = parent
end

Public Instance Methods

[]=(k, link) click to toggle source
Calls superclass method
# File lib/pmp/links.rb, line 15
def []=(k, link)
  super
  set_parent(link)
  add_link_name(k)
end
set_parent(link) click to toggle source
# File lib/pmp/links.rb, line 29
def set_parent(link)
  if link.respond_to?(:parent)
    link.parent = self.parent
  elsif link.is_a?(Hash)
    link.values.each{|l| set_parent(l)}
  elsif link.is_a?(Enumerable)
    link.each{|l| set_parent(l)}
  end
end