Actions
Feature #10018
closedConsider adding Sub-Includes as in include Foo::bar
Status:
Feedback
Assignee:
-
Target version:
-
Description
On IRC someone asked a nice question:
<arup_r> If I write
class Foo; include Enumerable; end
This code include all methods fromEnumerable
. But suppose I want to include#all?
,#any?
.. What's the way to include only required methods ?
This prompted me to write this.
What if ruby would allow us to include just singular methods?
Something like:
include Enumerable::any?
And so forth, so that we could cherry-pick what we want.
This is already possible in some projects, like facets.
But I think they solve it by splitting up the whole
stuff into individual files, and then including
this.
I think it would be nicer if include itself would
support a scope-mechanic.
Actions
Like0
Like0Like0Like0