Class: ThreadParent::Parents

Inherits:
Object
  • Object
show all
Defined in:
lib/ree_lib/packages/ree_dao/package/ree_dao/thread_parents.rb

Instance Method Summary collapse

Constructor Details

#initialize(child) ⇒ Parents

Returns a new instance of Parents.



6
7
8
# File 'lib/ree_lib/packages/ree_dao/package/ree_dao/thread_parents.rb', line 6

def initialize(child)
  @child = child
end

Instance Method Details

#[](key) ⇒ Object



10
11
12
13
14
15
16
# File 'lib/ree_lib/packages/ree_dao/package/ree_dao/thread_parents.rb', line 10

def [](key)
  if @child.key?(key)
    @child[key]
  elsif @child.parent
    @child.parent.parents[key]
  end
end