Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #7184 (closed defect: fixed)

Opened 2 years ago

Last modified 10 months ago

[PATCH] delegate documentation

Reported by: dcmanges Assigned to: core
Priority: normal Milestone: 2.x
Component: ActiveSupport Version: edge
Severity: normal Keywords: docs delegate
Cc:

Description

It seems natural to be able to delegate to an object, such as:

class Foo
  BAR = [0,1,2,3,4]
  delegate :each, :to => BAR
end

But delegate needs a symbol of the instance variable, class variable, or constant.

class Foo
  BAR = [0,1,2,3,4]
  delegate :each, :to => :BAR
end

This should be documented.

Attachments

doc_for_delegate.diff (1.1 kB) - added by dcmanges on 01/19/07 02:42:09.
docs_for_delegate.diff (1.3 kB) - added by jeremymcanally on 11/13/07 04:21:03.
Updated for edge

Change History

01/19/07 02:42:09 changed by dcmanges

  • attachment doc_for_delegate.diff added.

02/18/07 20:56:35 changed by josh

  • keywords changed from doc delegate to docs delegate.

11/13/07 04:20:40 changed by jeremymcanally

+1

Had to fix the patch for Edge and integrate with what's there, but I think this is good information.

11/13/07 04:21:03 changed by jeremymcanally

  • attachment docs_for_delegate.diff added.

Updated for edge

12/05/07 21:45:40 changed by marcel

  • status changed from new to closed.
  • resolution set to fixed.

(In [8311]) Document that the delegate method can delegate to things other than just methods. Closes #7184 [dcmanges, jeremymcanally]