るりまサーチ

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

別のキーワード

  1. open3 popen2e
  2. socket af_e164
  3. matrix det_e
  4. open3 capture2e
  5. matrix rank_e

キーワード

検索結果

<< 1 2 3 ... > >>

Net::HTTPGenericRequest#method -> String (27214.0)

リクエストの HTTP メソッドを文字列で返します。

...リクエストの HTTP メソッドを文字列で返します。

//emlist[例][ruby]{
require 'net/http'

uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Post.new(uri.request_uri)
req.method # => "POST"
req = Net::HTTP::Get.new(uri.request_uri)
req.method # => "GET"
//}...

Net::HTTPHeader#method -> String (27208.0)

リクエストの HTTP メソッドを文字列で返します。

...リクエストの HTTP メソッドを文字列で返します。

//emlist[例][ruby]{
require 'net/http'

uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.method # => "GET"
//}...

Object#method(name) -> Method (24449.0)

オブジェクトのメソッド name をオブジェクト化した Method オブジェクトを返します。

...name をオブジェクト化した
Method
オブジェクトを返します。

@param name メソッド名をSymbol またはStringで指定します。
@raise NameError 定義されていないメソッド名を引数として与えると発生します。

//emlist[][ruby]{
me = -365.method(:ab...
...s)
p me #=> #<Method: Integer#abs>
p me.call #=> 365
//}

@see Module#instance_method, Method, BasicObject#__send__, Object#send, Kernel.#eval, Object#singleton_method...

Method#super_method -> Method | nil (24379.0)

self 内で super を実行した際に実行されるメソッドを Method オブジェ クトにして返します。

...self 内で super を実行した際に実行されるメソッドを Method オブジェ
クトにして返します。

@see UnboundMethod#super_method

//emlist[例][ruby]{
class Super
def foo
"superclass method"
e
nd
e
nd

class Sub < Super
def foo
"subclass method"
e
nd
e
nd

m = S...
...ub.new.method(:foo) # => #<Method: Sub#foo>
m.call # => "subclass method"
m.super_method # => #<Method: Super#foo>
m.super_method.call # => "superclass method"
//}...

UnboundMethod#super_method -> UnboundMethod | nil (18314.0)

self 内で super を実行した際に実行されるメソッドを UnboundMethod オブジェ クトにして返します。

...self 内で super を実行した際に実行されるメソッドを UnboundMethod オブジェ
クトにして返します。


@see Method#super_method...

絞り込み条件を変える

Method#parameters -> [object] (18141.0)

Method オブジェクトの引数の情報を返します。

...Method オブジェクトの引数の情報を返します。

Method
オブジェクトが引数を取らなければ空の配列を返します。引数を取る場合は、配列の配列を返し、
各配列の要素は引数の種類に応じた以下のような Symbol と、仮引数の名...
...

: :req
必須の引数
: :opt
デフォルト値が指定されたオプショナルな引数
: :rest
* で指定された残りすべての引数
: :keyreq
必須のキーワード引数
: :key
デフォルト値が指定されたオプショナルなキーワード引数
: :keyrest
**...
...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, :k_other], [:block, :b
File.method(:symlink).parameters #=> req
//}

@see Proc#paramete...

Object#singleton_method(name) -> Method (15555.0)

オブジェクトの特異メソッド name をオブジェクト化した Method オブ ジェクトを返します。

...name をオブジェクト化した Method オブ
ジェクトを返します。

@param name メソッド名をSymbol またはStringで指定します。
@raise NameError 定義されていないメソッド名を引数として与えると発生します。

//emlist[][ruby]{
class Demo
def in...
...e(n)
@iv = n
e
nd
def hello()
"Hello, @iv = #{@iv}"
e
nd
e
nd

k = Demo.new(99)
def k.hi
"Hi, @iv = #{@iv}"
e
nd
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...

WIN32OLE_TYPE#ole_methods -> [WIN32OLE_METHOD] (15414.0)

型が持つメソッドのメタデータを取得します。

...@return 型が持つメソッドのメタデータをWIN32OLE_METHODの配列として返します。
メソッドを持たない場合は空配列を返します。


tobj = WIN32OLE_TYPE.new('Microsoft Excel 14.0 Object Library', 'Worksheet')
method
s = tobj.ole_methods.map {|m| m.name...
...}
# => ['QueryInterface', 'AddRef', 'Release',....]

@see WIN32OLE_METHOD...

BasicObject#singleton_method_undefined(name) -> object (15372.0)

特異メソッドが Module#undef_method または undef により未定義にされた時にインタプリタから呼び出されます。

...特異メソッドが Module#undef_method または
undef により未定義にされた時にインタプリタから呼び出されます。

通常のメソッドの未定義に対するフックには
Module#method_undefined を使います。

@param name 未定義にされたメソッド名...
.../emlist[例][ruby]{
class Foo
def singleton_method_undefined(name)
puts "singleton method \"#{name}\" was undefined"
e
nd
e
nd

obj = Foo.new
def obj.foo
e
nd
def obj.bar
e
nd

class << obj
undef_method :foo
e
nd
obj.instance_eval {undef bar}

#=> singleton method "foo" was undefined
# single...
...ton method "bar" was undefined
//}

@see Module#method_undefined,BasicObject#singleton_method_added,BasicObject#singleton_method_removed , d:spec/def#undef...

BasicObject#singleton_method_removed(name) -> object (15366.0)

特異メソッドが Module#remove_method に より削除された時にインタプリタから呼び出されます。

...ドが Module#remove_method
より削除された時にインタプリタから呼び出されます。

通常のメソッドの削除に対するフックには
Module#method_removedを使います。

@param name 削除されたメソッド名が Symbol で渡されます。

//emlist[例][ru...
...def singleton_method_removed(name)
puts "singleton method \"#{name}\" was removed"
e
nd
e
nd

obj = Foo.new
def obj.foo
e
nd

class << obj
remove_method :foo
e
nd

#=> singleton method "foo" was removed
//}

@see Module#method_removed,BasicObject#singleton_method_added,BasicObject#singleton_met...
...hod_undefined...

絞り込み条件を変える

<< 1 2 3 ... > >>