D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
opt
/
alt
/
ruby34
/
share
/
ri
/
system
/
Module
/
Filename :
module_function-i.ri
back
Copy
U:RDoc::AnyMethod[iI"module_function:ETI"Module#module_function;TF:privateo:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"ICreates module functions for the named methods. These functions may ;TI"Hbe called with the module as a receiver, and also become available ;TI"Cas instance methods to classes that mix in the module. Module ;TI"Afunctions are copies of the original, and so may be changed ;TI"Findependently. The instance-method versions are made private. If ;TI"Hused with no arguments, subsequently defined methods become module ;TI"functions. ;TI"0String arguments are converted to symbols. ;TI"5If a single argument is passed, it is returned. ;TI"0If no argument is passed, nil is returned. ;TI"NIf multiple arguments are passed, the arguments are returned as an array.;To:RDoc::Markup::BlankLine o:RDoc::Markup::Verbatim; [I"module Mod ;TI" def one ;TI" "This is one" ;TI" end ;TI" module_function :one ;TI" end ;TI"class Cls ;TI" include Mod ;TI" def call_one ;TI" one ;TI" end ;TI" end ;TI"#Mod.one #=> "This is one" ;TI"c = Cls.new ;TI"#c.call_one #=> "This is one" ;TI"module Mod ;TI" def one ;TI" "This is the new one" ;TI" end ;TI" end ;TI"#Mod.one #=> "This is one" ;TI"*c.call_one #=> "This is the new one";T:@format0: @fileI"vm_method.c;T:0@omit_headings_from_table_of_contents_below0I"�module_function -> nil module_function(method_name) -> method_name module_function(method_name, method_name, ...) -> array ;T0[ I"(*args);T@1FI"Module;TcRDoc::NormalClass00