4件ヒット
[1-4件を表示]
(0.021秒)
別のキーワード
種類
- インスタンスメソッド (2)
- 定数 (1)
- 文書 (1)
クラス
- Object (1)
- StringScanner (2)
検索結果
-
StringScanner
# terminate -> self (45358.0) -
スキャンポインタを文字列末尾後まで進め、マッチ記録を捨てます。
スキャンポインタを文字列末尾後まで進め、マッチ記録を捨てます。
@return self を返します。
pos = self.string.size と同じ動作です。
//emlist[例][ruby]{
require 'strscan'
s = StringScanner.new('test string')
s.scan(/\w+/) # => "test"
s.matched # => "test"
s.pos # => 4
s[0] # => "test"
s.terminate
s.matched # => nil
s[0]... -
StringScanner
# clear -> self (58.0) -
スキャンポインタを文字列末尾後まで進め、マッチ記録を捨てます。
スキャンポインタを文字列末尾後まで進め、マッチ記録を捨てます。
@return self を返します。
pos = self.string.size と同じ動作です。
//emlist[例][ruby]{
require 'strscan'
s = StringScanner.new('test string')
s.scan(/\w+/) # => "test"
s.matched # => "test"
s.pos # => 4
s[0] # => "test"
s.terminate
s.matched # => nil
s[0]... -
Object
:: DATA -> File (55.0) -
スクリプトの __END__ プログラムの終り以降をアクセスする File オブジェクト。
スクリプトの __END__
プログラムの終り以降をアクセスする File オブジェクト。
d:spec/program#terminateも参照。
ソースファイルの __END__ 以降は解析・実行の対象にならないので
その部分にプログラムが利用するためのデータを書き込んでおくことができます。
DATA 定数はそのデータ部分にアクセスするための File オブジェクトを保持しています。
__END__ を含まないプログラムにおいては DATA は定義されません。
=== 注意
* DATA.rewind で移動する読みとり位置は __END__ 直後ではなく、
... -
制御構造 (37.0)
-
制御構造 条件分岐: * if * unless * case 繰り返し: * while * until * for * break * next * redo * retry 例外処理: * raise * begin その他: * return * BEGIN * END
制御構造
条件分岐:
* if
* unless
* case
繰り返し:
* while
* until
* for
* break
* next
* redo
* retry
例外処理:
* raise
* begin
その他:
* return
* BEGIN
* END
Rubyでは(Cなどとは異なり)制御構造は式であって、何らかの値を返すものが
あります(返さないものもあります。値を返さない式を代入式の右辺に置くと
syntax error になります)。
R...