種類
- インスタンスメソッド (161)
- モジュール関数 (77)
- 文書 (22)
- 特異メソッド (11)
ライブラリ
-
irb
/ context (11) - json (88)
- objspace (22)
-
rexml
/ document (99) - scanf (18)
-
webrick
/ httputils (11)
クラス
-
IRB
:: Context (11) -
JSON
:: State (44) -
REXML
:: Attribute (11) -
REXML
:: Attributes (11) -
REXML
:: Element (22) -
Scanf
:: FormatString (6) - String (12)
モジュール
- JSON (44)
- ObjectSpace (22)
-
REXML
:: Namespace (55) -
WEBrick
:: HTTPUtils (11)
キーワード
- Ruby用語集 (11)
-
allocation
_ sourcefile (11) -
count
_ objects _ size (11) - escape (11)
- generate (11)
-
local
_ name (11) - name (11)
- namespace (22)
- namespaces (22)
- new (11)
- prefix (11)
-
pretty
_ generate (11) -
pretty
_ unparse (11) - scanf (12)
- space= (11)
-
space
_ before (11) -
space
_ before= (11) - unparse (11)
- 正規表現 (11)
検索結果
先頭5件
-
Scanf
:: FormatString # space (21101.0) -
@todo
@todo -
String
# scanf(format) -> Array (21018.0) -
ブロックを指定しない場合、見つかった文字列を format に従って変 換し、そのオブジェクトの配列を返します。 format で指定した文字列が見つからない場合は空の配列を 生成して返します。
...il], ["abc", 456], ["def", nil]]
@param format スキャンするフォーマットを文字列で指定します。
詳細は、m:String#scanf#format を参照してください。
使用例:
require 'scanf'
str = "123 abc 456 def 789 ghi"
p str.scanf("%d%s") #=> [123, "abc"]......が含まれます。
動作例;
# encoding: utf-8
require 'scanf'
str = "1 aaa"
p str.scanf("%d %s") #=> [1, "aaa"]
: space
フォーマット中の空白は(0個を含む)任意の数の空白にマッチします。
//emlist{
require 'scanf'
p "a 10".sc......%a
: %A
符号付き浮動小数点数
: %s
空白文字を含まない文字列
(幅が指定されているときは指定された文字数か空白文字の直前までの短い方)
: %c
1文字(幅が指定されているときは指定された文字数)
: [...]
d:spec/regexp#string... -
String
# scanf(format) {|*ary| . . . } -> Array (21018.0) -
ブロックを指定しない場合、見つかった文字列を format に従って変 換し、そのオブジェクトの配列を返します。 format で指定した文字列が見つからない場合は空の配列を 生成して返します。
...il], ["abc", 456], ["def", nil]]
@param format スキャンするフォーマットを文字列で指定します。
詳細は、m:String#scanf#format を参照してください。
使用例:
require 'scanf'
str = "123 abc 456 def 789 ghi"
p str.scanf("%d%s") #=> [123, "abc"]......が含まれます。
動作例;
# encoding: utf-8
require 'scanf'
str = "1 aaa"
p str.scanf("%d %s") #=> [1, "aaa"]
: space
フォーマット中の空白は(0個を含む)任意の数の空白にマッチします。
//emlist{
require 'scanf'
p "a 10".sc......%a
: %A
符号付き浮動小数点数
: %s
空白文字を含まない文字列
(幅が指定されているときは指定された文字数か空白文字の直前までの短い方)
: %c
1文字(幅が指定されているときは指定された文字数)
: [...]
d:spec/regexp#string... -
JSON
:: State # space -> String (18226.0) -
JSON 形式の文字列のトークン間に挿入する文字列を返します。
...equire "json"
json_state = JSON::State.new(space: "")
json_state.space # => ""
puts JSON.generate([1, 2, { name: "tanaka", age: 19 }], json_state)
# => [1,2,{"name":"tanaka","age":19}]
json_state = JSON::State.new(space: "\t")
json_state.space # => "\t"
puts JSON.generate([... -
REXML
:: Attributes # namespaces -> { String => String } (6302.0) -
self の中で宣言されている名前空間の集合を返します。
...p://example.org/foo"
xmlns:bar="http://example.org/bar">
<a foo:att='1' bar:att='2' att='<'/>
</root>
EOS
a = doc.get_elements("/root/a").first
p doc.root.attributes.namespaces
# => {"foo"=>"http://example.org/foo", "bar"=>"http://example.org/bar"}
p a.attributes.namespaces
# => {}
//}... -
REXML
:: Element # namespaces -> {String => String} (6302.0) -
self の文脈で定義されている名前空間の情報を返します。
...義されている名前空間を、{ prefix => 識別子 }
というハッシュテーブルで返します。
//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new("<a xmlns:x='1' xmlns:y='2'><b/><c xmlns:z='3'/></a>")
doc.elements['//b'].namespaces # => {"x"=>"1", "y"=>"2"}
//}... -
JSON
:: State # space=(string) (6232.0) -
JSON 形式の文字列のトークン間に挿入する文字列をセットします。
...に挿入する文字列をセットします。
@param string JSON 形式の文字列のトークン間に挿入する文字列を指定します。
//emlist[例][ruby]{
require "json"
json_state = JSON::State.new(space: "")
json_state.space # => ""
puts JSON.generate([1, 2, { name:......"tanaka", age: 19 }], json_state)
# => [1,2,{"name":"tanaka","age":19}]
json_state.space = "\t"
json_state.space # => "\t"
puts JSON.generate([1, 2, { name: "tanaka", age: 19 }], json_state)
# => [1,2,{"name": "tanaka","age": 19}]
//}... -
JSON
:: State # space _ before=(string) (6232.0) -
JSON 形式の文字列中で JavaScript のオブジェクトを表す部分にある ':' の 前に挿入する文字列をセットします。
...す。
@param string JSON 形式の文字列中で JavaScript のオブジェクトを表す部分にある ':' の
前に挿入する文字列をセットします。
//emlist[例][ruby]{
require "json"
json_state = JSON::State.new(space_before: "")
json_state.space_before......# => ""
puts JSON.generate([1, 2, { name: "tanaka", age: 19 }], json_state)
# => [1,2,{"name":"tanaka","age":19}]
json_state.space_before = " "
json_state.space_before # => " "
puts JSON.generate([1, 2, { name: "tanaka", age: 19 }], json_state)
# => [1,2,{"name" :"tanaka","age" :19}... -
JSON
:: State # space _ before -> String (6226.0) -
JSON 形式の文字列中で JavaScript のオブジェクトを表す部分にある ':' の 前に挿入する文字列を返します。
...on"
json_state = JSON::State.new(space_before: "")
json_state.space_before # => ""
puts JSON.generate([1, 2, { name: "tanaka", age: 19 }], json_state)
# => [1,2,{"name":"tanaka","age":19}]
json_state = JSON::State.new(space_before: " ")
json_state.space_before # => " "
puts... -
REXML
:: Attribute # namespace(arg = nil) -> String | nil (6201.0) -
属性の名前空間の URI を返します。
...//emlist[][ruby]{
require 'rexml/document'
e = REXML::Element.new("el")
e.add_attribute("xmlns:ns", "http://www.example.com/ns")
e.add_attribute("ns:r", "rval")
p e.attributes.get_attribute("r").prefix # => "ns"
p e.attributes.get_attribute("r").namespace # => "http://www.example.com/ns"
//}... -
REXML
:: Element # namespace(prefix=nil) -> String (6201.0) -
self の文脈で prefix が指している名前空間の URI を返します。
...ます。
//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new("<a xmlns='1' xmlns:y='2'><b/><c xmlns:z='3'/><y:d /></a>")
b = doc.elements['//b']
b.namespace # => "1"
b.namespace("y") # => "2"
b.namespace("z") # => nil
d = doc.elements['//y:d']
d.namespace # => "2"
//}...