456件ヒット
[401-456件を表示]
(0.054秒)
別のキーワード
クラス
- BasicObject (48)
-
JSON
:: Parser (12) - Method (12)
- Module (168)
- Object (168)
- UnboundMethod (48)
キーワード
- === (12)
- arity (12)
- bind (12)
-
class
_ eval (24) -
class
_ variables (12) - constants (12)
-
define
_ method (24) -
initialize
_ copy (12) -
instance
_ eval (24) -
instance
_ exec (12) -
instance
_ method (12) -
instance
_ methods (12) -
instance
_ of? (12) -
instance
_ variable _ defined? (12) -
instance
_ variable _ get (12) -
instance
_ variables (12) -
is
_ a? (12) -
kind
_ of? (12) -
method
_ added (12) - methods (12)
-
module
_ eval (24) -
original
_ name (12) - owner (12)
- parameters (12)
- parse (12)
-
public
_ method (12) -
remove
_ class _ variable (12) -
remove
_ const (12) -
remove
_ instance _ variable (12) -
respond
_ to? (12) -
singleton
_ method (12) -
singleton
_ method _ undefined (12) -
undef
_ method (12)
検索結果
先頭5件
-
Method
# parameters -> [object] (25.0) -
Method オブジェクトの引数の情報を返します。
...れた残りのキーワード引数
: :block
& で指定されたブロック引数
//emlist[例][ruby]{
m = Class.new{define_method(:m){|x, y=42, *other, k_x:, k_y: 42, **k_other, &b|}}.instance_method(:m)
m.parameters #=> x], [:opt, :y], [:rest, :other], [:keyreq, :k_x], [:key, :k_y], [:keyrest... -
Module
# method _ added(name) -> () (25.0) -
メソッド name が追加された時にインタプリタがこのメソッドを呼び出します。
...加されたメソッドの名前が Symbol で渡されます。
//emlist[例][ruby]{
class Foo
def Foo.method_added(name)
puts "method \"#{name}\" was added"
end
def foo
end
define_method :bar, instance_method(:foo)
end
# => method "foo" was added
# method "bar" was added
//}... -
Object
# public _ method(name) -> Method (25.0) -
オブジェクトの public メソッド name をオブジェクト化した Method オブジェクトを返します。
...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 (25.0) -
オブジェクトの特異メソッド name をオブジェクト化した Method オブ ジェクトを返します。
...tringで指定します。
@raise NameError 定義されていないメソッド名を引数として与えると発生します。
//emlist[][ruby]{
class Demo
def initialize(n)
@iv = n
end
def hello()
"Hello, @iv = #{@iv}"
end
end
k = Demo.new(99)
def k.hi
"Hi, @iv = #{@iv}"
en......d
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... -
UnboundMethod
# original _ name -> Symbol (25.0) -
オリジナルのメソッド名を返します。
...オリジナルのメソッド名を返します。
//emlist[例][ruby]{
class C
def foo; end
alias bar foo
end
C.instance_method(:bar).original_name # => :foo
//}
@see Method#original_name...