Sha256: d3ba9173c7daf5545aeede33eacc28a1c3f9cb9afcf137c13f62304286280216

Contents?: true

Size: 592 Bytes

Versions: 14

Compression:

Stored size: 592 Bytes

Contents

module Ridley
  # @author Jamie Winsor <reset@riotgames.com>
  # @api private
  class ChainLink
    attr_reader :parent
    attr_reader :child

    # @param [Class, Object] parent
    #   the parent class or object to send to the child
    # @param [Class, Object] child
    #   the child class or instance to delegate functions to
    def initialize(parent, child)
      @parent = parent
      @child  = child
    end

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

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

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
ridley-0.11.2 lib/ridley/chain_link.rb
ridley-0.12.0.rc1 lib/ridley/chain_link.rb
ridley-0.11.1 lib/ridley/chain_link.rb
ridley-0.10.2 lib/ridley/chain_link.rb
ridley-0.9.1 lib/ridley/chain_link.rb
ridley-0.10.1 lib/ridley/chain_link.rb
ridley-0.11.0.rc1 lib/ridley/chain_link.rb
ridley-0.10.0 lib/ridley/chain_link.rb
ridley-0.10.0.rc3 lib/ridley/chain_link.rb
ridley-0.10.0.rc2 lib/ridley/chain_link.rb
ridley-0.10.0.rc1 lib/ridley/chain_link.rb
ridley-0.9.0 lib/ridley/chain_link.rb
ridley-0.8.6 lib/ridley/chain_link.rb
ridley-0.8.5 lib/ridley/chain_link.rb