種類
- インスタンスメソッド (240)
- 文書 (77)
- クラス (36)
- 特異メソッド (24)
ライブラリ
- ビルトイン (12)
- etc (12)
-
net
/ http (12) - rake (48)
-
rdoc
/ code _ object (12) -
rdoc
/ context (12) -
rdoc
/ parser / simple (12) -
rdoc
/ text (12) -
rexml
/ document (108) -
ripper
/ filter (12) - zlib (24)
クラス
-
Etc
:: Passwd (12) -
RDoc
:: CodeObject (12) -
RDoc
:: Context :: Section (12) -
RDoc
:: Parser :: Simple (12) -
REXML
:: Comment (84) -
REXML
:: DocType (12) -
Rake
:: Task (24) -
WEBrick
:: Cookie (24) -
Zlib
:: GzipFile (12) -
Zlib
:: GzipWriter (12)
モジュール
-
Net
:: HTTPHeader (12) -
RDoc
:: Text (12) -
Rake
:: TaskManager (24)
キーワード
- <=> (12)
- == (12)
- Filter (12)
-
NEWS for Ruby 3
. 0 . 0 (5) - Rubyで使われる記号の意味(正規表現の複雑な記号は除く) (12)
- Ruby用語集 (12)
-
attribute
_ of (12) - comment (72)
- comment= (24)
-
content
_ type (12) -
full
_ comment (12) -
last
_ comment (12) -
last
_ description (12) - new (24)
-
normalize
_ comment (12) -
remove
_ private _ comments (12) -
ruby 1
. 6 feature (12) - string (12)
- string= (12)
-
to
_ s (12) - リテラル (12)
- 多言語化 (12)
- 正規表現 (12)
検索結果
先頭5件
-
REXML
:: DocType # attribute _ of(element , attribute) -> String | nil (113.0) -
DTD 内の属性リスト宣言で、 element という名前の要素の attribute という 名前の属性のデフォルト値を返します。
...(文字列)
//emlist[][ruby]{
require 'rexml/document'
doctype = REXML::Document.new(<<EOS).doctype
<!DOCTYPE books [
<!ELEMENT book (comment)>
<!ELEMENT comment (#PCDATA)>
<!ATTLIST book
author CDATA #REQUIRED
title CDATA #REQUIRED
publisher CDATA "foobar publisher">... -
Net
:: HTTPHeader # content _ type -> String|nil (107.0) -
"text/html" のような Content-Type を表す 文字列を返します。
...が存在しない場合には nil を返します。
//emlist[例][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/comments.cgi?post=comment')
req = Net::HTTP::Post.new(uri.request_uri)
req.content_type # => nil
req.content_type = 'multipart/form-data'
req.content_type # => "m... -
Ruby用語集 (96.0)
-
Ruby用語集 A B C D E F G I J M N O R S Y
...cent
: 0 オリジン
: zero-based
番号が 0 から始まること。
例えば、
Array や Vector、Matrix などの要素の番号、
String における文字の位置、
といったものは 0 オリジンである。
: 1 オリジン
: one-based
番号が 1 から始まるこ......1 個、2 個、3 個であることをそれぞれ unary、binary、
ternary と呼ぶことから作られた語。
: アンコメント
: uncomment
コメントアウトを解除すること。非コメント化。
→コメントアウト
: 安全参照演算子
: safe navigation opera......は
オブジェクトではない。
ただし、メソッド、ブロックはそれぞれオブジェクト化できる。
なお、「String オブジェクト」のような、クラス名+「オブジェクト」の
形の表現は、そのクラスのインスタンスを指す。... -
正規表現 (86.0)
-
正規表現 * metachar * expansion * char * anychar * string * str * quantifier * capture * grouping * subexp * selector * anchor * cond * option * encoding * comment * free_format_mode * absenceop * list * specialvar * references
...正規表現
* metachar
* expansion
* char
* anychar
* string
* str
* quantifier
* capture
* grouping
* subexp
* selector
* anchor
* cond
* option
* encoding
* comment
* free_format_mode
* absenceop
* list
* specialvar
* references
正規表現(regular ex......以外の
その文字列そのものにマッチするような文字列があります。
前者をメタ文字列(meta string)、後者をリテラル(文字列)(literal string)と呼びます。
//emlist[][ruby]{
/京都|大阪|神戸/
//}
という正規表現においては、「京都」「......く任意の1文字にマッチします。
ただし、オプション m によって改行にもマッチするようになります。
===[a:string] 文字クラス
文字クラス(character class)
とは角括弧 [ と ] で囲まれ、1個以上の文字を列挙したもので、
いずれ... -
多言語化 (78.0)
-
多言語化 Ruby は US-ASCII はもちろん、US-ASCII 以外の文字エンコーディングもサポートしています。 文字列の内部表現のエンコーディングは固定されておらず、 プログラマは目的に応じて使用するエンコーディングを選ぶことができます。
...できます。
同じプロセスの中で異なるエンコーディングの文字列が同時に存在することができます。
全ての String や Regexp などのオブジェクトは自身のエンコーディング情報を保持しています。
これにより各オブジェクト......トでスクリプトエンコーディングを指定すると、
Ruby スクリプトに非 ASCII 文字を使うことができます。(magic_comment)
文字列リテラルや正規表現リテラルだけでなく変数名、メソッド名、クラス名などにも
非 ASCII 文字を使う......ソッドを用います。
String#encode メソッドは文字列のエンコーディングを変換した新しい文字列を生成して返します。
Ruby 1.9 ではこれを用いてエンコーディングを変換するのが標準的なやり方です。
String#force_encoding メソッ... -
Rubyで使われる記号の意味(正規表現の複雑な記号は除く) (54.0)
-
Rubyで使われる記号の意味(正規表現の複雑な記号は除く) ex q num per and or plus minus ast slash hat sq period comma langl rangl eq tilde dollar at under lbrarbra lbra2rbra2 lbra3rbra3 dq colon ac backslash semicolon
...: /xxx/ !~ yyy
正規表現のメソッド =~ の否定。マッチが失敗したらtrueを返します。
===[a:q] ?
: ?a
d:spec/literal#string。長さ 1 の文字列。
: def xx?
この場合の「?」はメソッド名の一部分です。
慣用的に、真偽値を返すタイプ......現の、量指定子(quantifiers)。直前の正規表現の 0 または 1 回の繰り返し。
===[a:num] #
: #コメント
d:spec/lexical#comment。# から行末までがコメントになります。
: xxx #=> 実行結果
: xxx # => 実行結果
慣用的に実行結果を示すため......トの書き方。
: #! ruby -Ks
shebang。d:spec/rubycmd#shebangを参照。
: # coding: utf-8
マジックコメント。d:spec/m17n#magic_comment を参照。
: "a is #{a}"
d:spec/literal#exp
//emlist{
a = 10
p "a is #{a}" #=> "a is 10"
//}
: Range#each
説明文の中でのみ... -
Ripper
:: Filter (18.0) -
イベントドリブンスタイルで Ruby プログラムを加工するためのクラスです。
...ok, f)
f << CGI.escapeHTML(tok)
end
def on_comment(tok, f)
f << %Q[<span class="comment">#{CGI.escapeHTML(tok)}</span>]
end
def on_tstring_beg(tok, f)
f << %Q[<span class="string">#{CGI.escapeHTML(tok)}]
end
def on_tstring_end(tok, f)
f << %Q[#{CGI.escapeHTML(tok)}</sp...