るりまサーチ

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

別のキーワード

  1. fiddle ruby_free
  2. rbconfig ruby
  3. fiddle build_ruby_platform
  4. rake ruby
  5. rubygems/defaults ruby_engine

ライブラリ

クラス

モジュール

キーワード

検索結果

<< 1 2 > >>

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

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

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

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

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

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

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

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


r
equire 'fiddle/import'

module M
extend Fiddle::Importer
dlload "libc.so.6"
t
ypealias "size_t", "unsigned long"
extern "int qsort(void*, size_t, s...

Binding#local_variable_set(symbol, obj) (15267.0)

引数 symbol で指定した名前のローカル変数に引数 obj を設定します。

...param symbol ローカル変数名を Symbol オブジェクトで指定します。

@param obj 引数 symbol で指定したローカル変数に設定するオブジェクトを指定します。

//emlist[例][ruby]{
def foo
a = 1
bind
= binding
bind
.local_variable_set(:a, 2) # set existin...
...g local variable `a'
bind
.local_variable_set(:b, 3) # create new local variable `b'
# `b' exists only in binding
p bind.local_variable_get(:a) # => 2
p bind.local_variable_get(:b) # => 3
p a # => 2
p b...
...# => NameError
end
//}

このメソッドは以下のコード(ただし、obj が Ruby のコードで出力される場
合)と同様の動作をします。

//emlist[][ruby]{
bind
ing.eval("#{symbol} = #{obj}")
//}

@see Binding#local_variable_get, Binding#local_variable_defined?...

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

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

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

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

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

Binding#local_variable_get(symbol) -> object (15225.0)

引数 symbol で指定した名前のローカル変数に設定された値を返します。

...param symbol ローカル変数名を Symbol オブジェクトで指定します。

@raise NameError 引数 symbol で指定したローカル変数が未定義の場合に発生します。

//emlist[例][ruby]{
def foo
a = 1
bind
ing.local_variable_get(:a) # => 1
bind
ing.local_variable_get(...
...:b) # => NameError
end
//}

このメソッドは以下のコードの短縮形です。

//emlist[][ruby]{
bind
ing.eval("#{symbol}")
//}

@see Binding#local_variable_set, Binding#local_variable_defined?...

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

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

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

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

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

@see ERB#result_with_hash...

絞り込み条件を変える

TracePoint#binding -> Binding (12213.0)

発生したイベントによって生成された Binding オブジェクトを返します。

...発生したイベントによって生成された Binding オブジェクトを返します。


//emlist[例][ruby]{
def foo(ret)
r
et
end
t
race = TracePoint.new(:call) do |tp|
p tp.binding.local_variables # => [:ret]
end
t
race.enable
foo 1
//}...

TracePoint#binding -> Binding | nil (12213.0)

発生したイベントによって生成された Binding オブジェクトを返します。

...れた Binding オブジェクトを返します。

C で記述されたメソッドは binding を生成しないため、
:c_call および :c_return イベントに対しては nil を返すことに注意してください。

//emlist[例][ruby]{
def foo(ret)
r
et
end
t
race = TracePoint.new(:...
...call) do |tp|
p tp.binding.local_variables # => [:ret]
end
t
race.enable
foo 1
//}...

UnboundMethod#bind_call(recv, *args) -> object (9349.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 (9349.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#receiver -> object (9213.0)

保持するコンテキスト内での self を返します。

...保持するコンテキスト内での self を返します。

このメソッドは以下のコードと同様の動作をします。

//emlist[][ruby]{
bind
ing.eval("self")
//}...

絞り込み条件を変える

Kernel#httpd -> () (9119.0)

WEBrick HTTP server を起動します。

...rick HTTP server を起動します。

ruby
-run -e httpd -- [OPTION] [DocumentRoot]

--bind-address=ADDR バインドアドレスを指定します
--port=NUM ポート番号を指定します
--max-clients=MAX 同時接続数の最大値
--temp-dir=DIR...
...一時ディレクトリを指定します
--do-not-reverse-lookup 逆引きを無効にします
--request-timeout=SECOND リクエストがタイムアウトする秒数を指定します
--http-version=VERSION HTTP version
-v 詳細表示...
...--do-not-reverse-lookup 逆引きを無効にします
--request-timeout=SECOND リクエストがタイムアウトする秒数を指定します
--http-version=VERSION HTTP version
--server-name=NAME サーバーのホスト名を指定します
--server-software=NAME...
...サーバーの名前とバージョンを指定します
--ssl-certificate=CERT サーバーの SSL 証明書ファイルを指定します
--ssl-private-key=KEY サーバーの SSL 証明書の秘密鍵を指定します
-v 詳細表示...
<< 1 2 > >>