別のキーワード
ライブラリ
- ビルトイン (1083)
-
cgi
/ core (24) -
cgi
/ html (96) - delegate (36)
- erb (36)
- forwardable (96)
-
irb
/ cmd / help (12) -
irb
/ input-method (24) -
irb
/ output-method (60) - json (108)
-
minitest
/ spec (1) -
minitest
/ unit (2) -
net
/ imap (24) - pp (12)
- psych (8)
- rake (12)
-
rdoc
/ context (36) -
webrick
/ cgi (12) -
webrick
/ httpservlet / abstract (12) - win32ole (228)
クラス
- Array (10)
- BasicObject (72)
- CGI (24)
- Delegator (36)
- ERB (36)
- Enumerator (48)
-
IRB
:: ExtendCommand :: Help (12) -
IRB
:: OutputMethod (48) -
IRB
:: ReadlineInputMethod (12) -
IRB
:: StdioInputMethod (12) -
IRB
:: StdioOutputMethod (12) - Method (116)
-
MiniTest
:: Unit (1) - Module (488)
-
Net
:: IMAP (24) - Object (217)
- PP (12)
- Proc (26)
-
RDoc
:: Context (36) - Regexp (24)
- String (36)
- Thread (12)
- TracePoint (7)
- UnboundMethod (48)
-
WEBrick
:: CGI (12) -
WEBrick
:: HTTPServlet :: AbstractServlet (12) - WIN32OLE (72)
-
WIN32OLE
_ EVENT (12) -
WIN32OLE
_ METHOD (36) -
WIN32OLE
_ PARAM (108)
モジュール
-
CGI
:: HtmlExtension (96) - Forwardable (48)
-
JSON
:: Generator :: GeneratorMethods :: Array (12) -
JSON
:: Generator :: GeneratorMethods :: FalseClass (12) -
JSON
:: Generator :: GeneratorMethods :: Float (12) -
JSON
:: Generator :: GeneratorMethods :: Hash (12) -
JSON
:: Generator :: GeneratorMethods :: Integer (12) -
JSON
:: Generator :: GeneratorMethods :: NilClass (12) -
JSON
:: Generator :: GeneratorMethods :: Object (12) -
JSON
:: Generator :: GeneratorMethods :: String (12) -
JSON
:: Generator :: GeneratorMethods :: TrueClass (12) -
MiniTest
:: Assertions (1) - SingleForwardable (48)
キーワード
- << (14)
- == (24)
- === (8)
- >> (14)
- [] (24)
-
_ getproperty (12) -
_ invoke (12) -
_ setproperty (12) -
add
_ method (12) -
add
_ response _ handler (24) -
add
_ to (12) -
alias
_ method (12) -
assert
_ respond _ to (1) - bind (12)
- call (24)
-
class
_ exec (12) - curry (22)
-
def
_ class (12) -
def
_ delegator (24) -
def
_ delegators (24) -
def
_ instance _ delegator (12) -
def
_ instance _ delegators (12) -
def
_ method (12) -
def
_ module (12) -
def
_ single _ delegator (12) -
def
_ single _ delegators (12) - default (12)
-
define
_ method (24) -
define
_ singleton _ method (24) - dig (10)
- each (48)
- encode (36)
-
enum
_ for (24) - eql? (24)
- execute (12)
- form (48)
- handler= (12)
- header (12)
- input? (12)
-
instance
_ eval (24) -
instance
_ method (12) -
instance
_ methods (12) - line (24)
- match (24)
-
method
_ added (12) -
method
_ defined? (12) -
method
_ missing (36) -
method
_ removed (12) -
method
_ undefined (12) - methods (12)
-
module
_ exec (12) -
module
_ function (36) -
multipart
_ form (48) -
must
_ respond _ to (1) - name (12)
-
ole
_ method (12) -
ole
_ method _ help (12) -
ole
_ type (12) -
ole
_ type _ detail (12) - optional? (12)
- out (12)
- output? (12)
- parameters (43)
- params (12)
- pp (12)
- ppx (12)
- print (12)
- printn (12)
- private (48)
-
private
_ class _ method (24) -
private
_ instance _ methods (12) -
private
_ method _ defined? (12) -
private
_ methods (12) - protected (48)
-
protected
_ instance _ methods (12) -
protected
_ method _ defined? (12) -
protected
_ methods (24) -
psych
_ yaml _ as (4) - public (48)
-
public
_ class _ method (24) -
public
_ instance _ method (12) -
public
_ instance _ methods (12) -
public
_ method (12) -
public
_ method _ defined? (12) -
public
_ methods (24) - puke (1)
- puts (12)
-
rake
_ extension (12) -
remove
_ method (12) -
respond
_ to? (12) -
respond
_ to _ missing? (12) - retval? (12)
- send (24)
- seplist (12)
- service (24)
-
set
_ visibility _ for (12) -
singleton
_ method (12) -
singleton
_ method _ added (12) -
singleton
_ method _ removed (12) -
singleton
_ method _ undefined (12) -
singleton
_ methods (12) -
size
_ opt _ params (12) -
size
_ params (12) -
to
_ enum (24) -
to
_ json (108) -
to
_ s (12) -
undef
_ method (12) -
yaml
_ as (4)
検索結果
先頭5件
-
Module
# method _ defined?(name , inherit=true) -> bool (6382.0) -
モジュールにインスタンスメソッド name が定義されており、 かつその可視性が public または protected であるときに true を返します。
...@param name Symbol か String を指定します。
@param inherit 真を指定するとスーパークラスや include したモジュールで
定義されたメソッドも対象になります。
@see Module#public_method_defined?, Module#private_method_defined?, Module#protected_method......def method1() end
def protected_method1() end
protected :protected_method1
end
class B
def method2() end
def private_method2() end
private :private_method2
end
class C < B
include A
def method3() end
end
A.method_defined? :method1 #=> true
C.method_defined? "method1"......#=> true
C.method_defined? "method2" #=> true
C.method_defined? "method2", true #=> true
C.method_defined? "method2", false #=> false
C.method_defined? "method3" #=> true
C.method_defined? "protected_method1" #=> true
C.method_defined? "method4"... -
Object
# public _ method(name) -> Method (6361.0) -
オブジェクトの public メソッド name をオブジェクト化した Method オブジェクトを返します。
...オブジェクトの public メソッド name をオブジェクト化した
Method オブジェクトを返します。
@param name メソッド名を Symbol または String で指定します。
@raise NameError 定義されていないメソッド名や、
protected メソッド名、......vate メソッド名を引数として与えると発生します。
//emlist[][ruby]{
1.public_method(:to_int) #=> #<Method: Integer#to_int>
1.public_method(:p) # method `p' for class `Integer' is private (NameError)
//}
@see Object#method,Object#public_send,Module#public_instance_method... -
Object
# singleton _ method(name) -> Method (6361.0) -
オブジェクトの特異メソッド name をオブジェクト化した Method オブ ジェクトを返します。
...オブジェクトの特異メソッド name をオブジェクト化した Method オブ
ジェクトを返します。
@param name メソッド名をSymbol またはStringで指定します。
@raise NameError 定義されていないメソッド名を引数として与えると発生します......o.new(99)
def k.hi
"Hi, @iv = #{@iv}"
end
m = k.singleton_method(:hi) # => #<Method: #<Demo:0xf8b0c3c4 @iv=99>.hi>
m.call #=> "Hi, @iv = 99"
m = k.singleton_method(:hello) # => NameError
//}
@see Module#instance_method, Method, BasicObject#__send__, Object#send, Kernel.#eval, Object#method... -
Module
# define _ method(name , method) -> Symbol (6346.0) -
インスタンスメソッド name を定義します。
...す。
@param name メソッド名を String または Symbol を指定します。
@param method Proc、Method あるいは UnboundMethod の
いずれかのインスタンスを指定します。
@return メソッド名を表す Symbol を返します。
@raise TypeError method に同......じクラス、サブクラス、モジュール以外のメソッ
ドを指定した場合に発生します。
//emlist[例][ruby]{
class Foo
def foo() p :foo end
define_method(:bar, instance_method(:foo))
end
Foo.new.bar # => :foo
//}... -
Module
# instance _ method(name) -> UnboundMethod (6344.0) -
self のインスタンスメソッド name をオブジェクト化した UnboundMethod を返します。
...クト化した UnboundMethod を返します。
@param name メソッド名を Symbol または String で指定します。
@raise NameError self に存在しないメソッドを指定した場合に発生します。
@see Module#public_instance_method, Object#method
//emlist[例][ruby]{
clas......() print "!\n"; end
def do_v() print "Dave"; end
Dispatcher = {
"a" => instance_method(:do_a),
"d" => instance_method(:do_d),
"e" => instance_method(:do_e),
"v" => instance_method(:do_v)
}
def interpret(string)
string.each_char {|b| Dispatcher[b].bind(self).call }... -
Object
# define _ singleton _ method(symbol , method) -> Symbol (6340.0) -
self に特異メソッド name を定義します。
...self に特異メソッド name を定義します。
@param symbol メソッド名を String または Symbol で指定します。
@param method Proc、Method あるいは UnboundMethod の
いずれかのインスタンスを指定します。
@return メソッド名を表す Sy......t[][ruby]{
class A
class << self
def class_name
to_s
end
end
end
A.define_singleton_method(:who_am_i) do
"I am: #{class_name}"
end
A.who_am_i # ==> "I am: A"
guy = "Bob"
guy.define_singleton_method(:hello) { "#{self}: Hello there!" }
guy.hello #=> "Bob: Hello there!"
//}... -
Module
# public _ instance _ method(name) -> UnboundMethod (6338.0) -
self の public インスタンスメソッド name をオブジェクト化した UnboundMethod を返します。
...self の public インスタンスメソッド name をオブジェクト化した UnboundMethod を返します。
@param name メソッド名を Symbol または String で指定します。
@raise NameError 定義されていないメソッド名や、
protected メソッド名、 priva......として与えると発生します。
//emlist[例][ruby]{
Kernel.public_instance_method(:object_id) #=> #<UnboundMethod: Kernel#object_id>
Kernel.public_instance_method(:p) # method `p' for module `Kernel' is private (NameError)
//}
@see Module#instance_method,Object#public_method... -
ERB
# def _ method(mod , methodname , fname=& # 39;(ERB)& # 39;) -> nil (6326.0) -
変換した Ruby スクリプトをメソッドとして定義します。
...メソッド名は methodname で指定します。
fname はスクリプトを定義する際のファイル名です。主にエラー時に活躍します。
@param mod メソッドを定義するモジュール(またはクラス)
@param methodname メソッド名
@param fname スクリ......プトを定義する際のファイル名
例:
require 'erb'
erb = ERB.new(script)
erb.def_method(MyClass, 'foo(bar)', 'foo.erb')... -
Module
# private _ method _ defined?(name , inherit=true) -> bool (6322.0) -
インスタンスメソッド name がモジュールに定義されており、 しかもその可視性が private であるときに true を返します。 そうでなければ false を返します。
...@param name Symbol か String を指定します。
@param inherit 真を指定するとスーパークラスや include したモジュールで
定義されたメソッドも対象になります。
@see Module#method_defined?, Module#public_method_defined?, Module#protected_method_defin......def method1() end
end
class B
private
def method2() end
end
class C < B
include A
def method3() end
end
A.method_defined? :method1 #=> true
C.private_method_defined? "method1" #=> false
C.private_method_defined? "method2" #=> true
C.private_method_def......ined? "method2", true #=> true
C.private_method_defined? "method2", false #=> false
C.method_defined? "method2" #=> false
//}...