るりまサーチ

最速Rubyリファレンスマニュアル検索!
19988件ヒット [19901-19988件を表示] (0.202秒)
トップページ > クエリ:I[x] > クエリ:i[x] > クエリ:new[x]

別のキーワード

  1. _builtin to_i
  2. fiddle to_i
  3. matrix elements_to_i
  4. csv to_i
  5. _builtin i

ライブラリ

クラス

オブジェクト

キーワード

検索結果

<< < ... 198 199 200 >>

Object#enum_for(method = :each, *args) {|*args| ... } -> Enumerator (28.0)

Enumerator.new(self, method, *args) を返します。

...Enumerator.new(self, method, *args) を返します。

ブロックを指定した場合は Enumerator#size がブロックの評価結果を返
します。ブロックパラメータは引数 args です。


@param method メソッド名の文字列かシンボルです。
@param args 呼び出...
...に渡される引数です。

//emlist[][ruby]{
str = "xyz"

enum = str.enum_for(:each_byte)
p(a = enum.map{|b| '%02x' % b }) #=> ["78", "79", "7a"]

# protects an array from being modified
a = [1, 2, 3]
p(a.to_enum) #=> #<Enumerator: [1, 2, 3]:each>
//}

//emlist[例(ブロックを指定する...
...def repeat(n)
raise ArgumentError, "#{n} is negative!" if n < 0
unless block_given?
# __method__ はここでは :repeat
return to_enum(__method__, n) do
# size メソッドが nil でなければ size * n を返す。
sz = size
sz * n if sz
end...

Object#to_enum(method = :each, *args) -> Enumerator (28.0)

Enumerator.new(self, method, *args) を返します。

...Enumerator.new(self, method, *args) を返します。

ブロックを指定した場合は Enumerator#size がブロックの評価結果を返
します。ブロックパラメータは引数 args です。


@param method メソッド名の文字列かシンボルです。
@param args 呼び出...
...に渡される引数です。

//emlist[][ruby]{
str = "xyz"

enum = str.enum_for(:each_byte)
p(a = enum.map{|b| '%02x' % b }) #=> ["78", "79", "7a"]

# protects an array from being modified
a = [1, 2, 3]
p(a.to_enum) #=> #<Enumerator: [1, 2, 3]:each>
//}

//emlist[例(ブロックを指定する...
...def repeat(n)
raise ArgumentError, "#{n} is negative!" if n < 0
unless block_given?
# __method__ はここでは :repeat
return to_enum(__method__, n) do
# size メソッドが nil でなければ size * n を返す。
sz = size
sz * n if sz
end...

Object#to_enum(method = :each, *args) {|*args| ... } -> Enumerator (28.0)

Enumerator.new(self, method, *args) を返します。

...Enumerator.new(self, method, *args) を返します。

ブロックを指定した場合は Enumerator#size がブロックの評価結果を返
します。ブロックパラメータは引数 args です。


@param method メソッド名の文字列かシンボルです。
@param args 呼び出...
...に渡される引数です。

//emlist[][ruby]{
str = "xyz"

enum = str.enum_for(:each_byte)
p(a = enum.map{|b| '%02x' % b }) #=> ["78", "79", "7a"]

# protects an array from being modified
a = [1, 2, 3]
p(a.to_enum) #=> #<Enumerator: [1, 2, 3]:each>
//}

//emlist[例(ブロックを指定する...
...def repeat(n)
raise ArgumentError, "#{n} is negative!" if n < 0
unless block_given?
# __method__ はここでは :repeat
return to_enum(__method__, n) do
# size メソッドが nil でなければ size * n を返す。
sz = size
sz * n if sz
end...

Struct#select -> Enumerator (20.0)

構造体のメンバの値に対してブロックを評価した値が真であった要素を全て含 む配列を返します。真になる要素がひとつもなかった場合は空の配列を返しま す。

...mlist[例][ruby]{
Lots = Struct.new(:a, :b, :c, :d, :e, :f)
l = Lots.new(11, 22, 33, 44, 55, 66)
l.select {|v| (v % 2).zero? } #=> [22, 44, 66]
//}

[注意] 本メソッドの記述は Struct の下位クラスのインスタンスに対して呼び
出す事を想定しています。Struct.new...

Pathname#realpath -> Pathname (18.0)

余計な "."、".." や "/" を取り除いた新しい Pathname オブジェクトを返します。

...edir ベースディレクトリを指定します。省略するとカレントディレクトリになります。

//emlist[例][ruby]{
require 'pathname'

Dir.rmdir("/tmp/foo") rescue nil
File.unlink("/tmp/bar/foo") rescue nil
Dir.rmdir("/tmp/bar") rescue nil

Dir.mkdir("/tmp/foo")
Dir...
....mkdir("/tmp/bar")
File.symlink("../foo", "/tmp/bar/foo")
path = Pathname.new("bar/././//foo/../bar")

Dir.chdir("/tmp")

p path.realpath

# => ruby 1.8.0 (2003-10-10) [i586-linux]
# #<Pathname:/tmp/bar>
//}

@see Pathname#realdirpath, File.realpath...

絞り込み条件を変える

Regexp#==(other) -> bool (18.0)

otherが同じパターン、オプション、文字コードの正規表現であったらtrueを返します。

...らtrueを返します。

@param other 正規表現を指定します。

//emlist[例][ruby]{
p /^eee$/ == /~eee$/x # => false
p /^eee$/ == /~eee$/i # => false
p /^eee$/e == /~eee$/u # => false
p /^eee$/ == Regexp.new("^eee$") # => true
p /^eee$/.eql?(/^eee$/) # => true
//}...

Regexp#eql?(other) -> bool (18.0)

otherが同じパターン、オプション、文字コードの正規表現であったらtrueを返します。

...らtrueを返します。

@param other 正規表現を指定します。

//emlist[例][ruby]{
p /^eee$/ == /~eee$/x # => false
p /^eee$/ == /~eee$/i # => false
p /^eee$/e == /~eee$/u # => false
p /^eee$/ == Regexp.new("^eee$") # => true
p /^eee$/.eql?(/^eee$/) # => true
//}...

VALUE Data_Make_Struct(VALUE klass, type, RUBY_DATA_FUNC mark, RUBY_DATA_FUNC free, type *svar) (18.0)

type 型の構造体をヒープに割り当ててそれへのポインタを svar に代入し、クラス klass のインスタンスである Ruby のオブジェクトを生成し、それを返します。mark free はそれぞれマーク用・解放用の関数へのポインタです。 どちらも、必要ないときはかわりに 0 を渡します。

...A_FUNC の定義は以下のようです。

typedef void (*RUBY_DATA_FUNC)(void *st)

第一引数 st には svar の値が渡されます。

使用例

struct mytype {
i
nt i;
char *s;
};

VALUE
my_s_new(klass)
VALUE klass;
{
struct mytype *d...

rake (18.0)

Rake というコマンドラインツールを扱うライブラリです。

...ake は以下のような特徴を持っています。

* Rakefile (Rake における Makefile) は標準的な Ruby の文法で書くことができます。
XML ファイルを編集する必要はありませんし、Makefile の風変わりな文法 (タブだっけ?スペースだっ...
...サポートしています。
* 配列のように振る舞うフレキシブルな FileList メソッドがあります。
FileList はファイル名やパス名を扱うのに便利です。
* Rakefile をより簡単に作成するためにこのライブラリにはいくつかのタ...
...e --help
rake [-f rakefile] {options} targets...
Options are ...
-C, --classic-namespace トップレベルに Task, FileTask を定義します。
過去との互換性のためのオプションです。
-D, --describe [PATTERN] パタ...
<< < ... 198 199 200 >>