別のキーワード
種類
- インスタンスメソッド (1401)
- モジュール関数 (211)
- 特異メソッド (127)
- クラス (88)
- オブジェクト (11)
クラス
- Array (9)
- BasicObject (66)
- Enumerator (58)
-
Enumerator
:: Lazy (44) - Exception (11)
- Method (247)
- Module (343)
- NameError (22)
- NoMethodError (36)
- Object (198)
- Proc (50)
- Refinement (3)
- Regexp (44)
-
RubyVM
:: InstructionSequence (99) - String (55)
- Thread (11)
- TracePoint (39)
- UnboundMethod (163)
モジュール
- Kernel (189)
- Marshal (22)
-
RubyVM
:: AbstractSyntaxTree (8)
オブジェクト
- main (22)
キーワード
- << (12)
- == (22)
- === (7)
- >> (12)
- BasicObject (11)
- InstructionSequence (11)
- NameError (11)
- NoMethodError (11)
- Numeric (11)
- Proc (11)
- UnboundMethod (11)
- [] (22)
-
_ _ callee _ _ (11) -
_ _ method _ _ (11) -
absolute
_ path (11) -
alias
_ method (11) - args (11)
- arity (22)
- backtrace (11)
-
base
_ label (11) - bind (11)
-
bind
_ call (10) - call (22)
-
callee
_ id (11) - caller (33)
-
class
_ exec (11) - clone (22)
- curry (20)
-
define
_ method (44) -
define
_ singleton _ method (22) - dig (9)
- disasm (11)
- disassemble (11)
- dump (22)
- each (44)
- encode (33)
-
enum
_ for (44) - eql? (22)
- eval (22)
- fail (33)
-
first
_ lineno (11) - hash (22)
-
import
_ methods (3) - inspect (22)
-
instance
_ eval (22) -
instance
_ method (11) -
instance
_ methods (11) - label (11)
- lambda (17)
- lambda? (11)
-
last
_ match (22) - main (11)
- match (22)
- method (11)
-
method
_ added (11) -
method
_ defined? (11) -
method
_ id (11) -
method
_ missing (11) -
method
_ removed (11) -
method
_ undefined (11) - methods (11)
-
module
_ exec (11) -
module
_ function (19) - name (33)
- new (42)
- of (19)
-
original
_ name (22) - owner (22)
- parameters (39)
- path (11)
- private (23)
-
private
_ call? (8) -
private
_ class _ method (15) -
private
_ instance _ methods (11) -
private
_ method _ defined? (11) -
private
_ methods (11) - proc (18)
- protected (23)
-
protected
_ instance _ methods (11) -
protected
_ method _ defined? (11) -
protected
_ methods (11) - public (23)
-
public
_ class _ method (15) -
public
_ instance _ method (11) -
public
_ instance _ methods (11) -
public
_ method (11) -
public
_ method _ defined? (11) -
public
_ methods (11) - raise (33)
- receiver (11)
-
remove
_ method (11) -
require
_ relative (11) -
respond
_ to? (11) -
respond
_ to _ missing? (11) -
ruby2
_ keywords (10) - send (22)
-
singleton
_ method (11) -
singleton
_ method _ added (11) -
singleton
_ method _ removed (11) -
singleton
_ method _ undefined (11) -
singleton
_ methods (11) -
source
_ location (33) -
super
_ method (20) -
to
_ a (11) -
to
_ enum (44) -
to
_ proc (11) -
to
_ s (44) -
to
_ str (11) - unbind (11)
-
undef
_ method (11)
検索結果
先頭5件
-
Method
# eql?(other) -> bool (21014.0) -
自身と other が同じインスタンスの同じメソッドを表す場合に true を返します。そうでない場合に false を返します。
...ッドを表す場合に
true を返します。そうでない場合に false を返します。
@param other 自身と比較したいオブジェクトを指定します。
//emlist[例][ruby]{
s = "bar"
a = s.method(:size)
b = s.method(:size)
p a == b #=> true
//}... -
Method
# hash -> Integer (21014.0) -
自身のハッシュ値を返します。
...自身のハッシュ値を返します。
//emlist[例][ruby]{
a = method(:==)
b = method(:eql?)
p a.eql? b # => true
p a.hash == b.hash # => true
p [a, b].uniq.size # => 1
//}... -
Method
# name -> Symbol (21014.0) -
このメソッドの名前を返します。
...このメソッドの名前を返します。
//emlist[例][ruby]{
class Foo
def foo(arg)
"foo called with arg #{arg}"
end
end
m = Foo.new.method(:foo) # => #<Method: Foo#foo>
m.name # => :foo
//}... -
Method
# receiver -> object (21014.0) -
このメソッドオブジェクトのレシーバを返します。
...のメソッドオブジェクトのレシーバを返します。
//emlist[例][ruby]{
class Foo
def foo(arg)
"foo called with arg #{arg}"
end
end
m = Foo.new.method(:foo) # => #<Method: Foo#foo>
m.receiver # => #<Foo:0x007fb39203eb78>
m.receiver.foo(1) # => "foo called with arg 1"
//}... -
Method
# to _ proc -> Proc (21014.0) -
self を call する Proc オブジェクトを生成して返します。
...self を call する Proc オブジェクトを生成して返します。
//emlist[例][ruby]{
class Foo
def foo
"foo"
end
end
m = Foo.new.method(:foo) # => #<Method: Foo#foo>
pr = m.to_proc # => #<Proc:0x007f874d026008 (lambda)>
pr.call # => "foo"
//}... -
Method
# original _ name -> Symbol (21008.0) -
オリジナルのメソッド名を返します。
...オリジナルのメソッド名を返します。
//emlist[例][ruby]{
class C
def foo; end
alias bar foo
end
C.new.method(:bar).original_name # => :foo
//}
@see UnboundMethod#original_name... -
UnboundMethod
# super _ method -> UnboundMethod | nil (9215.0) -
self 内で super を実行した際に実行されるメソッドを UnboundMethod オブジェ クトにして返します。
...self 内で super を実行した際に実行されるメソッドを UnboundMethod オブジェ
クトにして返します。
@see Method#super_method... -
Module
# method _ defined?(name , inherit=true) -> bool (6271.0) -
モジュールにインスタンスメソッド name が定義されており、 かつその可視性が public または protected であるときに true を返します。
...e#public_method_defined?, Module#private_method_defined?, Module#protected_method_defined?
//emlist[例][ruby]{
module A
def method1() end
def protected_method1() end
protected :protected_method1
end
class B
def method2() end
def private_method2() end
private :private_method2
end
cl......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" #=> false
C.method_defined? "private_method2" #=> false
//}... -
Object
# public _ method(name) -> Method (6256.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 (6256.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... -
Object
# method(name) -> Method (6250.0) -
オブジェクトのメソッド name をオブジェクト化した Method オブジェクトを返します。
...した
Method オブジェクトを返します。
@param name メソッド名をSymbol またはStringで指定します。
@raise NameError 定義されていないメソッド名を引数として与えると発生します。
//emlist[][ruby]{
me = -365.method(:abs)
p me #=> #<Method: Integer#......abs>
p me.call #=> 365
//}
@see Module#instance_method, Method, BasicObject#__send__, Object#send, Kernel.#eval, Object#singleton_method...