# Class: YARD::CodeObjects::ExtendedMethodObject

Inherits:
  Object
  - Object
  - YARD::CodeObjects::ExtendedMethodObject
  show all

Defined in:
  lib/yard/code_objects/extended_method_object.rb

## Overview

Represents an instance method of a module that was mixed into the class scope of another namespace.

See Also:

- MethodObject

## Instance Method Summary collapse

- #initialize(obj) ⇒ ExtendedMethodObject constructor

  Sets up a delegate for MethodObject obj.

- #method_missing(sym, *args, &block) ⇒ Object

  Sends all methods to the MethodObject assigned in #initialize.

- #scope ⇒ Symbol

  Always `:class`.

## Constructor Details

### #initialize(obj) ⇒ `ExtendedMethodObject`

Sets up a delegate for MethodObject obj.

Parameters:

- obj (`MethodObject`) —

  the instance method to treat as a mixed in class method on another namespace.

    17

    # File 'lib/yard/code_objects/extended_method_object.rb', line 17

    def initialize(obj) @del = obj end

## Dynamic Method Handling

This class handles dynamic methods through the `method_missing` method

### #method_missing(sym, *args, &block) ⇒ `Object`

Sends all methods to the MethodObject assigned in #initialize

See Also:

- #initialize
- MethodObject

    22

    # File 'lib/yard/code_objects/extended_method_object.rb', line 22

    def method_missing(sym, *args, &block) @del.__send__(sym, *args, &block) end

## Instance Method Details

### #scope ⇒ `Symbol`

Returns always `:class`.

Returns:

- (`Symbol`) —

  always `:class`

    11

    # File 'lib/yard/code_objects/extended_method_object.rb', line 11

    def scope; :class end