D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
opt
/
alt
/
ruby34
/
share
/
ri
/
system
/
Refinement
/
Filename :
import_methods-i.ri
back
Copy
U:RDoc::AnyMethod[iI"import_methods:ETI"Refinement#import_methods;TF:publico:RDoc::Markup::Document:@parts[ o:RDoc::Markup::Paragraph; [I":Imports methods from modules. Unlike Module#include, ;TI"QRefinement#import_methods copies methods and adds them into the refinement, ;TI"<so the refinement is activated in the imported methods.;To:RDoc::Markup::BlankLine o; ; [I"XNote that due to method copying, only methods defined in Ruby code can be imported.;T@o:RDoc::Markup::Verbatim; [I"module StrUtils ;TI" def indent(level) ;TI" ' ' * level + self ;TI" end ;TI" end ;TI" ;TI"module M ;TI" refine String do ;TI"! import_methods StrUtils ;TI" end ;TI" end ;TI" ;TI" using M ;TI""foo".indent(3) ;TI"#=> " foo" ;TI" ;TI"module M ;TI" refine String do ;TI"# import_methods Enumerable ;TI"T # Can't import method which is not defined with Ruby code: Enumerable#drop ;TI" end ;TI"end;T:@format0: @fileI"class.c;T:0@omit_headings_from_table_of_contents_below0I",import_methods(module, ...) -> self ;T0[[I"import_methods;T@ I"(*args);T@,FI"Refinement;TcRDoc::NormalClass00