るりまサーチ

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

別のキーワード

  1. erb u
  2. util u
  3. matrix u
  4. _builtin koi8_u
  5. encoding koi8_u

ライブラリ

クラス

モジュール

キーワード

検索結果

<< 1 2 > >>

UnboundMethod#bind(obj) -> Method (24132.0)

self を obj にバインドした Method オブジェクトを生成して返します。

...Error objがbindできないオブジェクトである場合に発生します

//emlist[例][ruby]{
# クラスのインスタンスメソッドの UnboundMethod の場合
class Foo
def foo
"foo"
end
end

# UnboundMethod `m' を生成
p m = Foo.instance_method(:foo) # => #<UnboundMethod: F...
...bind(Foo.new) # => #<Method: Foo#foo>

# Foo のサブクラス Bar のインスタンスをレシーバとする Method
class Bar < Foo
end
p m.bind(Bar.new) # => #<Method: Bar(Foo)#foo>


# モジュールのインスタンスメソッドの UnboundMethod の場合
modu...
..."foo"
end
end

# UnboundMethod `m' を生成
p m = Foo.instance_method(:foo) # => #<UnboundMethod: Foo#foo>

# Foo をインクルードしたクラス Bar のインスタンスをレシーバと
# する Method オブジェクトを生成
class Bar
include Foo
end
p m.bind(Bar.new)...

UDPSocket#bind(host, port) -> 0 (21136.0)

ソケットを host の port に bind(2) します。

...ソケットを host の port に bind(2) します。

bind
したポートから Socket#recv でデータを受け取ることができます。

@param host bind するホスト名文字列
@param port bind するポート番号...

UDPSocket#bind(host, port) -> Integer (21130.0)

UDPSocket#bindのパラメータ host の名前解決に resolv ライブラリを使います。

...UDPSocket#bindのパラメータ host の名前解決に resolv
ライブラリを使います。

@param host bindするホスト名を文字列で指定します。
@param port bindするポートを指定します。
@raise SocketError 名前解決に失敗した場合に発生します。...

Fiddle::Importer#bind(signature, *opts) { ... } -> Fiddle::Function (18208.0)

Ruby のブロックを C の関数で wrap し、その関数をモジュールに インポートします。

...Ruby のブロックを C の関数で wrap し、その関数をモジュールに
インポートします。

これでインポートされた関数はモジュール関数として定義されます。
また、Fiddle::Importer#[] で Fiddle::Function オブジェクトとして
取り出す...
...きます。

signature で関数の名前とシネグチャを指定します。例えば
"int compare(void*, void*)" のように指定します。

opts には :stdcall もしくは :cdecl を渡すことができ、
呼出規約を明示することができます。

@return インポートし...
...関数を表す Fiddle::Function オブジェクトを返します。

@param signature 関数の名前とシネグチャ
@param opts オプション


require 'fiddle/import'

module M
extend Fiddle::Importer
dlload "libc.so.6"
typealias "size_t", "unsigned long"
extern "in...

Method#unbind -> UnboundMethod (12407.0)

self のレシーバとの関連を取り除いた UnboundMethod オブ ジェクトを生成して返します。

...関連を取り除いた UnboundMethod オブ
ジェクトを生成して返します。

//emlist[例][ruby]{
class Foo
def foo
"foo"
end
end

m = Foo.new.method(:foo) # => #<Method: Foo#foo>
u
nbound_method = m.unbind # => #<UnboundMethod: Foo#foo>
u
nbound_method.bind(Foo.new) # => #<Method...

絞り込み条件を変える

UnboundMethod#bind_call(recv, *args) -> object (12137.0)

self を recv に bind して args を引数として呼び出します。

...self を recv に bind して args を引数として呼び出します。

self.bind(recv).call(*args) と同じ意味です。

//emlist[][ruby]{
puts Kernel.instance_method(:inspect).bind_call(BasicObject.new) # => #<BasicObject:0x000055c65e8ea7b8>
//}

@see UnboundMethod#bind, Method#call...

UnboundMethod#bind_call(recv, *args) { ... } -> object (12137.0)

self を recv に bind して args を引数として呼び出します。

...self を recv に bind して args を引数として呼び出します。

self.bind(recv).call(*args) と同じ意味です。

//emlist[][ruby]{
puts Kernel.instance_method(:inspect).bind_call(BasicObject.new) # => #<BasicObject:0x000055c65e8ea7b8>
//}

@see UnboundMethod#bind, Method#call...

Binding#source_location -> [String, Integer] (9101.0)

self の Ruby のソースファイル名と行番号を返します。

...self の Ruby のソースファイル名と行番号を返します。

d:spec/variables#pseudo の __FILE__ と __LINE__ も参照してください。

//emlist[例][ruby]{
p binding.source_location # => ["test.rb", 1]
//}...

IRB::Frame#trace_func(event, file, line, id, binding) -> Binding (6301.0)

ライブラリ内部で使用します。

ライブラリ内部で使用します。

ERB#result(b=TOPLEVEL_BINDING) -> String (6201.0)

ERB を b の binding で実行し、結果の文字列を返します。

...ERB を b の binding で実行し、結果の文字列を返します。

@param b eRubyスクリプトが実行されるときのbinding

//emlist[例][ruby]{
require 'erb'
erb = ERB.new("test <%= test1 %>\ntest <%= test2 %>\n")
test1 = "foo"
test2 = "bar"
puts erb.result
# test foo
# test bar
//...
...}

@see ERB#result_with_hash...

絞り込み条件を変える

<< 1 2 > >>