るりまサーチ

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

別のキーワード

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

ライブラリ

クラス

モジュール

キーワード

検索結果

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

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

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

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

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

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


require
'fiddle/import'

module M
extend Fiddle::Imp...
...orter
dlload "libc.so.6"
typealias "size_t", "unsigned long"
extern "int qsort(void*, size_t, size_t, void*)"

bind
("int compare(void*, void*)"){|px, py|
x = px.to_s(Fiddle::SIZEOF_INT).unpack("i!")
y = py.to_s(Fiddle::SIZEOF_INT).unpack("i!")

x <=> y
}
e...

ERB#result(b=TOPLEVEL_BINDING) -> String (125.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
//...
...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 E...

ERB#run(b=TOPLEVEL_BINDING) -> nil (119.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"
erb.run
# test foo
# test bar
//}...