るりまサーチ

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

ライブラリ

キーワード

検索結果

<< 1 2 3 ... > >>

Kernel#DelegateClass(superclass) -> object (2.0)

クラス superclass のインスタンスへメソッドを委譲するクラスを定義し、そのクラスを返します。

クラス superclass のインスタンスへメソッドを委譲するクラスを定義し、そのクラスを返します。

- **param** `superclass` -- 委譲先となるクラス

```ruby title="例"
require 'delegate'

class ExtArray < DelegateClass(Array)
def initialize
super([])
end
end
a = ExtArray.new
p a.class # => ExtArray
a.push 25
p a # => [25]
```

Kernel#Digest(name) -> object (2.0)

"MD5"や"SHA1"などのダイジェストを示す文字列 name を指定し、対応するダイジェストのクラスを取得します。

...c:Digest::MD5]などを直接呼び出すと問題があるときはこのメソッドを使うか、起動時に使用するライブラリを [m:Kernel?.require] してください。

- **param** `name` -- "MD5"や"SHA1"などのダイジェストを示す文字列を指定します。
- **return...

Kernel#JSON(object, options = {}) -> object (2.0)

第一引数に与えられたオブジェクトの種類によって Ruby のオブジェクトか JSON 形式の文字列を返します。

第一引数に与えられたオブジェクトの種類によって Ruby のオブジェクトか JSON 形式の文字列を返します。

第一引数に文字列のようなオブジェクトを指定した場合は、それを [m:JSON?.parse] を用いてパースした結果を返します。
そうでないオブジェクトを指定した場合は、それを [m:JSON?.generate] を用いて変換した結果を返します。

- **param** `object` -- 任意のオブジェクトを指定します。

- **param** `options` -- [m:JSON?.parse], [m:JSON?.generate] に渡すオプションを指定しま...

Kernel#arg_config(config, default) { ... } -> object | String | true | nil (2.0)

configure オプション --config の値を返します。

configure オプション --config の値を返します。

- **param** `config` -- オプションを文字列で指定します。

- **param** `default` -- 引数 config で指定したオプションのデフォルト値を指定します。

- **return** -- オプションが指定されてた場合は true を、指定されなかった場合は
nil を返します。
引数 default、あるいはブロックを指定すると、オプションが指定されていない場合に引数 default の値かブロックの評価結果を返します
(両方...

Kernel#cc_command(opt = "") -> String (2.0)

実際にコンパイルする際に使用するコマンドを返します。

実際にコンパイルする際に使用するコマンドを返します。

- **param** `opt` -- コンパイラに与える追加のコマンドライン引数を指定します。

- **SEE** [m:RbConfig.expand]

絞り込み条件を変える

Kernel#check_signedness(type, headers = nil, opts = nil) -> "signed" | "unsigned" | nil (2.0)

```text Returns the signedness of the given +type+. You may optionally specify additional +headers+ to search in for the +type+. If the +type+ is found and is a numeric type, a macro is passed as a preprocessor constant to the compiler using the +type+ name, in uppercase, prepended with 'SIGNEDNESS_OF_', followed by the +type+ name, followed by '=X' where 'X' is positive integer if the +type+ is unsigned, or negative integer if the +type+ is signed. For example, if size_t is defined as unsigned, then check_signedness('size_t') would returned +1 and the SIGNEDNESS_OF_SIZE_T=+1 preprocessor macro would be passed to the compiler, and SIGNEDNESS_OF_INT=-1 if check_signedness('int') is done. ```

```text
Returns the signedness of the given +type+. You may optionally
specify additional +headers+ to search in for the +type+.

If the +type+ is found and is a numeric type, a macro is passed as a
preprocessor constant to the compiler using the +type+ name, in
uppercase, prepended with 'SIGNEDN...

Kernel#check_signedness(type, headers = nil, opts = nil) { ... } -> "signed" | "unsigned" | nil (2.0)

```text Returns the signedness of the given +type+. You may optionally specify additional +headers+ to search in for the +type+. If the +type+ is found and is a numeric type, a macro is passed as a preprocessor constant to the compiler using the +type+ name, in uppercase, prepended with 'SIGNEDNESS_OF_', followed by the +type+ name, followed by '=X' where 'X' is positive integer if the +type+ is unsigned, or negative integer if the +type+ is signed. For example, if size_t is defined as unsigned, then check_signedness('size_t') would returned +1 and the SIGNEDNESS_OF_SIZE_T=+1 preprocessor macro would be passed to the compiler, and SIGNEDNESS_OF_INT=-1 if check_signedness('int') is done. ```

```text
Returns the signedness of the given +type+. You may optionally
specify additional +headers+ to search in for the +type+.

If the +type+ is found and is a numeric type, a macro is passed as a
preprocessor constant to the compiler using the +type+ name, in
uppercase, prepended with 'SIGNEDN...

Kernel#check_sizeof(type, headers = nil) -> Integer | nil (2.0)

与えられた型のサイズを返します。

与えられた型のサイズを返します。

型 type がシステムに存在する場合は、グローバル変数 [m:$defs] に
"-DSIZEOF_type=X" を追加し、型のサイズを返します。型 type がシステムに存在しない場合は、nil を返します。

例えば、

```ruby
require 'mkmf'
p check_sizeof('mystruct') # => 12
```

である場合、SIZEOF_MYSTRUCT=12 というプリプロセッサマクロをコンパイラに渡します。

- **param** `type` -- 検査したい型を指定します。

- **param** `h...
<< 1 2 3 ... > >>