Class: Ridley::ChainLink Private

Inherits:
Object
  • Object
show all
Defined in:
lib/ridley/chain_link.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Author:

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(parent, child) ⇒ ChainLink

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of ChainLink.

Parameters:

  • parent (Class, Object)

    the parent class or object to send to the child

  • child (Class, Object)

    the child class or instance to delegate functions to



12
13
14
15
# File 'lib/ridley/chain_link.rb', line 12

def initialize(parent, child)
  @parent = parent
  @child  = child
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(fun, *args, &block) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



21
22
23
# File 'lib/ridley/chain_link.rb', line 21

def method_missing(fun, *args, &block)
  child.send(fun, parent, *args, &block)
end

Instance Attribute Details

#childObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



6
7
8
# File 'lib/ridley/chain_link.rb', line 6

def child
  @child
end

#parentObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



5
6
7
# File 'lib/ridley/chain_link.rb', line 5

def parent
  @parent
end

Instance Method Details

#new(*args) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



17
18
19
# File 'lib/ridley/chain_link.rb', line 17

def new(*args)
  child.send(:new, parent, *args)
end