るりまサーチ

最速Rubyリファレンスマニュアル検索!
115件ヒット [1-100件を表示] (0.023秒)

別のキーワード

  1. win32ole ole_methods
  2. fileutils methods
  3. win32ole ole_put_methods
  4. win32ole ole_func_methods
  5. win32ole ole_get_methods

検索結果

<< 1 2 > >>

Object#send(name, *args) -> object (18204.0)

オブジェクトのメソッド name を args を引数に して呼び出し、メソッドの実行結果を返します。

...クもそのまま引き渡します。

send
が再定義された場合に備えて別名 __send__ も
用意されており、ライブラリではこちらを使うべきです。また
__send__ は再定義すべきではありません。

send
, __send__ は、メソッドの呼び出し制限...
...ば良い場合は
Object#public_send を使う方が良いでしょう。

@param name 文字列かSymbol で指定するメソッド名です。
@param args 呼び出すメソッドに渡す引数です。

//emlist[][ruby]{
p -365.send(:abs) #=> 365
p "ruby".send(:sub,/./,"R") #=> "Ruby"


class...
...
methods
= {1 => :foo,
2 => :bar,
3 => :baz}

# キーを使って関連するメソッドを呼び出す
# レシーバは任意(Foo クラスのインスタンスである必要もない)
p Foo.new.send(methods[1]) # => "foo"
p Foo.new.send(methods[2]) # => "bar"
p Foo.new.send(me...

Object#send(name, *args) { .... } -> object (18204.0)

オブジェクトのメソッド name を args を引数に して呼び出し、メソッドの実行結果を返します。

...クもそのまま引き渡します。

send
が再定義された場合に備えて別名 __send__ も
用意されており、ライブラリではこちらを使うべきです。また
__send__ は再定義すべきではありません。

send
, __send__ は、メソッドの呼び出し制限...
...ば良い場合は
Object#public_send を使う方が良いでしょう。

@param name 文字列かSymbol で指定するメソッド名です。
@param args 呼び出すメソッドに渡す引数です。

//emlist[][ruby]{
p -365.send(:abs) #=> 365
p "ruby".send(:sub,/./,"R") #=> "Ruby"


class...
...
methods
= {1 => :foo,
2 => :bar,
3 => :baz}

# キーを使って関連するメソッドを呼び出す
# レシーバは任意(Foo クラスのインスタンスである必要もない)
p Foo.new.send(methods[1]) # => "foo"
p Foo.new.send(methods[2]) # => "bar"
p Foo.new.send(me...

1.6.8から1.8.0への変更点(まとめ) (234.0)

1.6.8から1.8.0への変更点(まとめ) * ((<1.6.8から1.8.0への変更点(まとめ)/インタプリタの変更>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加されたクラス/モジュール>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加されたメソッド>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加された定数>)) * ((<1.6.8から1.8.0への変更点(まとめ)/拡張されたクラス/メソッド(互換性のある変更)>)) * ((<1.6.8から1.8.0への変更点(まとめ)/変更されたクラス/メソッド(互換性のない変更)>)) * ((<1.6.8から1.8.0への変更点(まとめ)/文法の変更>)) * ((<1.6.8から1.8.0への変更点(まとめ)/正規表現>)) * ((<1.6.8から1.8.0への変更点(まとめ)/Marshal>)) * ((<1.6.8から1.8.0への変更点(まとめ)/Windows 対応>)) * ((<1.6.8から1.8.0への変更点(まとめ)/廃止された(される予定の)機能>)) * ((<1.6.8から1.8.0への変更点(まとめ)/ライブラリ>)) * ((<1.6.8から1.8.0への変更点(まとめ)/拡張ライブラリAPI>)) * ((<1.6.8から1.8.0への変更点(まとめ)/バグ修正>)) * ((<1.6.8から1.8.0への変更点(まとめ)/サポートプラットフォームの追加>))

...d_defined?>)) [new]

: ((<Module#public_method_defined?|Module/public_method_defined?>)) [new]
: ((<Object#methods|Object/methods>)) [change]
: ((<Module#instance_methods|Module/instance_methods>)) [change]

追加。変更(仕様の統一)

: ((<Module#include?|Module/include?>)) [new]

Added....
...[new]
: ((<UNIXSocket/UNIXSocket.socketpair>)) [new]
: ((<UNIXSocket#recv_io|UNIXSocket/recv_io>)) [new]
: ((<UNIXSocket#send_io|UNIXSocket/send_io>)) [new]

追加

: ((<UNIXServer#listen|UNIXServer/listen>)) [new]
: ((<TCPServer#listen|TCPServer/listen>)) [new]...
...bject#singleton_methods|Object/singleton_methods>)) [compat]
省略可能な引数 all が追加されました。

: ((<Object#methods|Object/methods>)) [compat]
: ((<Object#public_methods|Object/public_methods>)) [compat]
: ((<Object#private_methods|Object/private_methods>)) [compat]
: (...

NEWS for Ruby 3.0.0 (96.0)

NEWS for Ruby 3.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。

...arning
# 3.0 => a=>1}, {}]
//}

* Arguments forwarding (`...`) now supports leading arguments.
16378

//emlist{
def method_missing(meth, ...)
send
(:"do_#{meth}", ...)
end
//}

* Pattern matching (`case/in`) is no longer experimental. 17260
* One-line pattern matching is redesigned....
...* `$SAFE` and `$KCODE` are now normal global variables with no special behavior.
C-API methods related to `$SAFE` have been removed.
16131 17136
* yield in singleton class definitions in methods is now a SyntaxError
instead of a warning. yield in a class definition outside of a meth...
...trace-limit` option limits the maximum length of a backtrace.
8661

== Core classes updates

Outstanding ones only.

* Array
* The following methods now return Array instances instead of subclass instances when called on subclass instances: 6087
* Array#drop
* Array#drop_while...

Method (72.0)

Object#method によりオブジェクト化され たメソッドオブジェクトのクラスです。

...シュに保持しておく
methods
= {1 => obj.method(:foo),
2 => obj.method(:bar),
3 => obj.method(:baz)}

# キーを使って関連するメソッドを呼び出す
p methods[1].call # => "foo"
p methods[2].call # => "bar"
p methods[3].call # => "baz"
//}...
...blic_sendを使う方法も有用。

//emlist[例][ruby]{
class Foo
def foo() "foo" end
def bar() "bar" end
def baz() "baz" end
end

# 任意のキーとメソッド(の名前)の関係をハッシュに保持しておく
# レシーバの情報がここにはないことに注意
methods
= {...
...関連するメソッドを呼び出す
# レシーバは任意(Foo クラスのインスタンスである必要もない)
p Foo.new.public_send(methods[1]) # => "foo"
p Foo.new.public_send(methods[2]) # => "bar"
p Foo.new.public_send(methods[3]) # => "baz"
//}

@see Object#method...

絞り込み条件を変える

Module#ruby2_keywords(method_name, ...) -> nil (44.0)

For the given method names, marks the method as passing keywords through a normal argument splat. This should only be called on methods that accept an argument splat (`*args`) but not explicit keywords or a keyword splat. It marks the method such that if the method is called with keyword arguments, the final hash argument is marked with a special flag such that if it is the final element of a normal argument splat to another method call, and that method call does not include explicit keywords or a keyword splat, the final element is interpreted as keywords. In other words, keywords will be passed through the method to other methods.

...e method as passing keywords through
a normal argument splat. This should only be called on methods that
accept an argument splat (`*args`) but not explicit keywords or a
keyword splat. It marks the method such that if the method is called
with keyword arguments, the final hash argument is marked...
...eyword splat, the final element is interpreted as
keywords. In other words, keywords will be passed through the method to
other methods.

This should only be used for methods that delegate keywords to another
method, and only for backwards compatibility with Ruby versions before
2.7.

This method wi...
...aware that if this method is removed, the behavior of the
method will change so that it does not pass through keywords.

//emlist[例][ruby]{
module Mod
def foo(meth, *args, &block)
send
(:"do_#{meth}", *args, &block)
end
ruby2_keywords(:foo) if respond_to?(:ruby2_keywords, true)
end
//}...

irb/completion (42.0)

irb の completion 機能を提供するライブラリです。

...foo.protected_methods
foo.=== foo.hash foo.public_methods
foo.=~ foo.id foo.respond_to?
foo.__id__ foo.inspect foo.send
foo.__send__ foo.instance_eval foo.singleton_methods
foo.class...
...foo.to_a
foo.dup foo.kind_of? foo.to_s
foo.eql? foo.method foo.type
foo.equal? foo.methods foo.untaint
foo.extend foo.nil?
foo.freeze foo.private_methods...

ruby 1.9 feature (36.0)

ruby 1.9 feature ruby version 1.9.0 は開発版です。 以下にあげる機能は将来削除されたり互換性のない仕様変更がなされるかもしれません。 1.9.1 以降は安定版です。 バグ修正がメインになります。

..._identity?

=== 2006-09-11

: Hash#identical
: Hash#identical?

=== 2006-08-31

: Array#shuffle
: Array#shuffle!

追加

=== 2006-07-26

: __send
: __send!

追加

: invoke_method
: invoke_functional_method

削除

=== 2006-07-21

: Module#attr

オプショナル引数の assignable が...
...oc

=== 2006-06-10

* 新機能
: BasicObject が導入されました [new]
: local という visibility および Module#local, Module#local_methods というメソッドが導入されました [new]
#: VIS_MASK が 16
: ancestors にモジュールが複数回挿入できるようになり...
...\0b*") # => ["foo", "bar"]
p Dir.glob("{f*,b*}") # => ["foo", "bar"]

=== 2005-09-05
: fcall [new]

追加

=== 2005-08-30
: Object#send, Object#__send__ [ruby][change]
レシーバを指定した呼び出しではprivateメソッドを呼び出せなくなりました。

=== 2005-06-09...

Object#initialize_copy(obj) -> object (30.0)

(拡張ライブラリによる) ユーザ定義クラスのオブジェクトコピーの初期化メソッド。

...ted?}"
print "singleton methods: "
begin
p obj.bar
rescue NameError
p $!
end
end

obj.foo = 1
obj.taint

check Object.new.send(:initialize_copy, obj)
#=> instance variables: #<Object:0x4019c9d4>
# tainted?: false
# singleton methods: #<NoMethodError: ...>...
...ect:0x4019c9c0 @foo=1>
# tainted?: true
# singleton methods: #<NoMethodError: ...>
check obj.clone
#=> instance variables: #<Object:0x4019c880 @foo=1>
# tainted?: true
# singleton methods: :bar
//}

@see Object#initialize_clone, Object#initialize_dup...
...ariables: #{obj.inspect}"
print "singleton methods: "
begin
p obj.bar
rescue NameError
p $!
end
end

obj.foo = 1

check Object.new.send(:initialize_copy, obj)
#=> instance variables: #<Object:0x4019c9d4>
# singleton methods: #<NoMethodError: ...>
check obj.dup...
...#=> instance variables: #<Object:0x4019c9c0 @foo=1>
# singleton methods: #<NoMethodError: ...>
check obj.clone
#=> instance variables: #<Object:0x4019c880 @foo=1>
# singleton methods: :bar
//}

@see Object#initialize_clone, Object#initialize_dup...
<< 1 2 > >>