66件ヒット
[1-66件を表示]
(0.042秒)
ライブラリ
- ビルトイン (22)
- continuation (11)
-
irb
/ context (11) -
rexml
/ document (11) -
rinda
/ rinda (11)
キーワード
- Context (11)
- Continuation (11)
- Enumerator (11)
- NotationDecl (11)
- Stat (11)
- Template (11)
検索結果
-
Rinda
:: Template (6031.0) -
タプルのマッチングのためのクラスです。 ユーザがこのクラスを直接使うことはありません。
...template = Rinda::Template.new(['abc', nil, nil])
template.match(['abc', 2, 5]) # => true
template.match(['hoge', 2, 5]) # => false
template = Rinda::Template.new([String, Integer, nil])
template.match(['abc', 2, 5]) # => true
template.match(['abcd', 2, 5]) # => true
template = Rin......da::Template.new([/^abc/, Integer, nil])
template.match([/^abc/, Integer, nil]) # => true
template.match(['abc', 2, 5]) # => true
template.match(['def', 2, 5]) # => false
template = Rinda::Template.new({'name' => String, 'age' => Integer})
template.match({'name' => 'seki'......, 'age' => 0x20}) # => true
template.match({'name' => :seki, 'age' => 0x20}) # => false... -
REXML
:: NotationDecl (6013.0) -
DTD の記法宣言を表すクラスです。
...TYPE foo [
<!NOTATION type-image-svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!NOTATION type-image-gif PUBLIC "image/gif">
<!NOTATION foobar SYSTEM "http://example.org/foobar.dtd">
]>
EOS
svg = doctype.notation("type-image......svg"
p svg.to_s # => "<!NOTATION type-image-svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">"
p svg.public # => "-//W3C//DTD SVG 1.1//EN"
p svg.system # => "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"
gif = doctype.notation("type-image-gif")
p gif........to_s # => "<!NOTATION type-image-gif PUBLIC \"image/gif\">"
p gif.public # => "image/gif"
p gif.system # => nil
foobar = doctype.notation("foobar")
p foobar.name # => "foobar"
p foobar.to_s # => "<!NOTATION foobar SYSTEM \"http://example.org/foobar.dtd\">"
p foobar.public # => nil
p foobar.system... -
Continuation (6007.0)
-
継続を表すクラスです。
...ル変数の定義、スタックフレーム)を cont に記憶
してブロックを実行します。cont は、Continuation クラスのインスタ
ンスで、Continuation#call メソッドを実行するこ
とでいつでも記憶した状態を継続することができます。
C 言語......)
callcc() は、ブロックの戻り値を返しますが、Continuation#call(args)
が呼び出されたときは args を返します。
例:
以下は、Continuationによる無限ループの例
def LOOP
c = nil
yield callcc {|cnt| c = cnt; true }
c.call(false)
end......LOOP {|v| p v}
=> true
false
false
false
:
:
callcc とは、call-with-current-continuation の略です。... -
Enumerator (6007.0)
-
each 以外のメソッドにも Enumerable の機能を提供するためのラッパークラスです。 また、外部イテレータとしても使えます。
...元にして定義されます。
Enumerator を介することにより String#each_byte のような
異なる名前のイテレータについても each と同様に Enumerable の機能を利用できます。
Enumerator を生成するには Enumerator.newあるいは
Object#to_enum, Object#e......or を利用します。また、一部の
イテレータはブロックを渡さずに呼び出すと繰り返しを実行する代わりに
enumerator を生成して返します。
=== 注意
外部イテレータとしての機能は Fiber を用いて実装されているため Fiber と同... -
File
:: Stat (6007.0) -
ファイルの情報を格納したオブジェクトのクラス。
...に取るかわりに Stat 自身について判定する点が違います。
//emlist[][ruby]{
p File::Stat.new($0).directory? #=> false
p FileTest.directory?($0) #=> false
//}
1.8 以降では、属性メソッドがシステムでサポートされていない場合 nil が返ります。
な......ァイルサイズ(バイト単位)
blksize 望ましいI/Oのブロックサイズ
blocks 割り当てられているブロック数
atime 最終アクセス時刻
mtime 最終更新時刻
ctime 最終状態変更時刻(状態の変更とは chmod などによ... -
IRB
:: Context (25.0) -
irb の設定を扱うためのクラスです。
...に記述できる以下の設定値については、IRB::Context
オブジェクトのメソッドとして操作できません。
: IRB.conf[:AT_EXIT]
irb の終了時(サブ irb を含みません)に本項目に設定された Proc オ
ブジェクトを実行します。ブロック引......ていた場合は、現在のワー
クスペースをそのまま使用します。
デフォルト値は 3 です。
: IRB.conf[:IRB_LIB_PATH]
ライブラリ内部で使用します。
: IRB.conf[:IRB_RC]
irb の起動時(サブ irb を含みます)に本項目に設定された Pro......IRB::Context が渡されます。
そのため、サブ irb の設定をまとめて実行するのに使用します。
デフォルト値は nil です。
lib:irb#configure_sub_irb も併せて参照してください。
: IRB.conf[:LC_MESSAGES]
ライブラリ内部で使用します...