242件ヒット
[1-100件を表示]
(0.137秒)
ライブラリ
- ビルトイン (44)
-
rake
/ rdoctask (77) -
rexml
/ document (77) -
webrick
/ httpresponse (44)
クラス
-
REXML
:: DocType (77) -
Rake
:: RDocTask (77) - String (44)
-
WEBrick
:: HTTPResponse (44)
キーワード
- [] (11)
-
attribute
_ of (11) -
content
_ length (11) -
content
_ length= (11) - entities (11)
- entity (11)
-
external
_ id (11) - hex (11)
- main (11)
- name (22)
-
option
_ string (11) - public (11)
- quote (11)
-
rdoc
_ dir (11) - system (11)
- template (11)
- title (11)
-
to
_ f (11) -
to
_ i (11) -
to
_ s (11)
検索結果
先頭5件
-
String
# oct -> Integer (39198.0) -
文字列を 8 進文字列であると解釈して、整数に変換します。
...例][ruby]{
p "10".oct # => 8
p "010".oct # => 8
p "8".oct # => 0
//}
oct は文字列の接頭辞 ("0", "0b", "0B", "0x", "0X") に応じて
8 進以外の変換も行います。
//emlist[例][ruby]{
p "0b10".oct # => 2
p "10".oct # => 8
p "010".oct # => 8
p "0x10".oct # => 16
//}
整......list[例][ruby]{
p "-010".oct # => -8
p "-0x10".oct # => -16
p "-0b10".oct # => -2
p "1_0_1x".oct # => 65
//}
@see String#hex, String#to_i, String#to_f,
Kernel.#Integer, Kernel.#Float
逆に、数値を文字列に変換するにはKernel.#sprintf,
String#%, Integer#to_s を使... -
String
# hex -> Integer (21031.0) -
文字列に 16 進数で数値が表現されていると解釈して整数に変換します。 接頭辞 "0x", "0X" とアンダースコアは無視されます。 文字列が [_0-9a-fA-F] 以外の文字を含むときはその文字以降を無視します。
...# => 0
p "10z".hex # => 16
p "1_0".hex # => 16
p "".hex # => 0
//}
@see String#oct, String#to_i, String#to_f,
Kernel.#Integer, Kernel.#Float
このメソッドの逆に数値を文字列に変換するには
Kernel.#sprintf, String#%,
Integer#to_s
などを使ってください。... -
String
# to _ f -> Float (21031.0) -
文字列を 10 進数表現と解釈して、浮動小数点数 Float に変換します。
...# => Infinity
# warning: Float 10101010101010101010... out of range
//}
なお、このメソッドとは逆に、数値を文字列に変換するには
Kernel.#sprintf, String#%, Integer#to_s
を使用します。
@see String#hex, String#oct, String#to_i,
Kernel.#Integer, Kernel.#Float... -
String
# to _ i(base = 10) -> Integer (21031.0) -
文字列を 10 進数表現された整数であると解釈して、整数に変換します。
...する整数。0 か、2〜36 の整数。
@return 整数
このメソッドの逆に数値を文字列に変換するには、
Kernel.#sprintf, String#%, Integer#to_s
を使用します。
String#hex, String#oct, String#to_f,
Kernel.#Integer, Kernel.#Float
も参照してください。... -
Rake
:: RDocTask # option _ string -> String (9203.0) -
rdoc コマンドに渡すオプションを文字列として返します。
rdoc コマンドに渡すオプションを文字列として返します。 -
REXML
:: DocType # attribute _ of(element , attribute) -> String | nil (3102.0) -
DTD 内の属性リスト宣言で、 element という名前の要素の attribute という 名前の属性のデフォルト値を返します。
...re '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">
]>
EOS
p doctype.attribute_of("boo......k", "publisher") # => "foobar publisher"
p doctype.attribute_of("bar", "foo") # => nil
p doctype.attribute_of("book", "baz") # => nil
p doctype.attribute_of("book", "title") # => nil
//}... -
REXML
:: DocType # entities -> { String => REXML :: Entity } (3102.0) -
DTD で宣言されている実体の集合を Hash で返します。
...{
doctype = REXML::Document.new(<<EOS).doctype
<!DOCTYPE foo [
<!ENTITY bar "barbarbarbar">
]>
EOS
p doctype.entities # => { "gt" => #<REXML::Entity: ...>,
# "lt" => #<REXML::Entity: ...>, ... }
p doctype.entities["bar"].to_s # => "<!ENTITY bar \"barbarbarbar\">"
p doctyp... -
REXML
:: DocType # entity(name) -> String | nil (3102.0) -
name という実体参照名を持つ実体を文字列で返します。
...つ実体が存在しない場合には nil を返します。
@param name 実体参照名(文字列)
//emlist[][ruby]{
doctype = REXML::Document.new(<<EOS).doctype
<!DOCTYPE foo [
<!ENTITY bar "barbarbarbar">
]>
EOS
p doctype.entity("bar") # => "barbarbar"
p doctype.entity("foo") # => nil
//}... -
REXML
:: DocType # external _ id -> String | nil (3102.0) -
DTD が外部サブセットを用いている場合は "SYSTEM", "PUBLIC" の いずれかの文字列を返します。
...ocument'
doctype = REXML::Document.new(<<EOS).doctype
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
EOS
doctype.name # => "html"
doctype.external_id # => "PUBLIC"
doctype = REXML::Document.new(<<EOS).doctype
<!DOCTYPE books......[
<!ELEMENT books (book+)>
<!ELEMENT book (title,author)>
<!ELEMENT title (#PCDATA)>
<!ELEMENT author (#PCDATA)>
]>
EOS
doctype.name # => "books"
doctype.external_id # => nil
//}... -
REXML
:: DocType # name -> String (3102.0) -
ルート要素名を返します。
...ルート要素名を返します。
//emlist[][ruby]{
document = REXML::Document.new(<<EOS)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
EOS
doctype = document.doctype
p doctype.name # => "html"
//}...