るりまサーチ (Ruby 2.5.0)

最速Rubyリファレンスマニュアル検索!
14件ヒット [1-14件を表示] (0.029秒)

別のキーワード

  1. string []=
  2. string []
  3. string slice
  4. string slice!
  5. string gsub

検索結果

Psych::Visitors::YAMLTree.new(options = {}, emitter = Psych::TreeBuilder.new, ss = Psych::ScalarScanner.new) -> Psych::Visitors::YAMLTree (54934.0)

YAMLTree オブジェクトを生成します。

...定します。
Psych
.dump と同じオプションが指定できます。

emitter には AST の構築に使われる Psych::TreeBuilder オブジェクト
を渡します。

ss は Ruby の String が YAML document 上で quote が必要かどうか
を判定するための Psych::ScalarScanner...
...常デフォルトのものから変える必要はないでしょう。

@param options オプション
@param emitter AST の構築に使う Psych::TreeBuilder オブジェクト
@param ss 文字列に quite が必要かどうかを判定するための Psych::ScalarScanner オブジェクト...

Psych::Nodes::Document#tag_directives -> [[String, String]] (631.0)

tag directive の配列を返します。

...tag directive の配列を返します。

@see Psych::Nodes::Document#tag_directives=,
Psych
::Nodes::Document.new...

Psych.dump(o, options = {}) -> String (364.0)

Ruby のオブジェクト o を YAML ドキュメントに変換します。

...[例][ruby]{
# Dump an array, get back a YAML string
Psych
.dump(['a', 'b']) # => "---\n- a\n- b\n"

# Dump an array to an IO object
Psych
.dump(['a', 'b'], StringIO.new) # => #<StringIO:0x000001009d0890>

# Dump an array with indentation set
Psych
.dump(['a', ['b']], :indentation => 3) # => "---\n-...
...a\n- - b\n"

# Dump an array to an IO with indentation set
Psych
.dump(['a', ['b']], StringIO.new, :indentation => 3)
//}...

Psych::ScalarScanner#tokenize(string) -> object (346.0)

YAML の scalar である文字列を Ruby のオブジェクトに変換した ものを返します。

...YAML の scalar である文字列を Ruby のオブジェクトに変換した
ものを返します。

scanner = Psych::ScalarScanner.new
p scanner.tokenize("yes") # => true
p scanner.tokenize("year") # => "year"
p scanner.tokenize("12") # => 12

@param string 変換文字列...

Psych::Nodes::Alias#anchor -> String (328.0)

alias が指す先の anchor を返します。

...alias が指す先の anchor を返します。

@see Psych::Nodes::Alias#anchor=,
Psych
::Nodes::Alias.new...

絞り込み条件を変える

Psych::Nodes::Mapping#anchor -> String|nil (328.0)

mapping に付加された anchor を返します。

...mapping に付加された anchor を返します。

@see Psych::Nodes::Mapping#anchor=,
Psych
::Nodes::Mapping.new...

Psych::Nodes::Mapping#tag -> String|nil (328.0)

mapping に付加された tag を返します。

...mapping に付加された tag を返します。

@see Psych::Nodes::Mapping#tag=,
Psych
::Nodes::Mapping.new...

Psych::Nodes::Scalar#anchor -> String|nil (328.0)

scalar に付加された anchor を返します。

...scalar に付加された anchor を返します。

@see Psych::Nodes::Scalar#anchor=,
Psych
::Nodes::Scalar.new...

Psych::Nodes::Scalar#tag -> String|nil (328.0)

scalar に付加された tag を返します。

...scalar に付加された tag を返します。

@see Psych::Nodes::Scalar#tag=,
Psych
::Nodes::Scalar.new...

Psych::Nodes::Scalar#value -> String (328.0)

scalar の値を返します。

...scalar の値を返します。

@see Psych::Nodes::Scalar#value=,
Psych
::Nodes::Scalar.new...

絞り込み条件を変える

Psych::Nodes::Sequence#anchor -> String|nil (328.0)

sequence に付加された anchor を返します。

...sequence に付加された anchor を返します。

@see Psych::Nodes::Sequence#anchor=,
Psych
::Nodes::Sequence.new...

Psych::Nodes::Sequence#tag -> String|nil (328.0)

sequence に付加された tag を返します。

...sequence に付加された tag を返します。

@see Psych::Nodes::Sequence#tag=,
Psych
::Nodes::Sequence.new...

Psych::Emitter (97.0)

Psych::Parser でパースし、生じたイベントから YAML ドキュメントを再構築するようなハンドラです。

...Psych::Parser でパースし、生じたイベントから
YAML ドキュメントを再構築するようなハンドラです。

以下の例では STDIN から YAML ドキュメントを入力し、
再構築した YAML ドキュメントを STDERR に出力します。

parser = Psych::Pars...
...w(Psych::Emitter.new($stderr))
parser.parse($stdin)

また、以下のようにイベントを手動で発生させることで
YAML ドキュメントを構築させることもできます。
各メソッドの意味については Psych::Handler を参照してください。
require 'psych'...
...put = StringIO.new
emitter = Psych::Emitter.new(output)

emitter.start_stream(Psych::Parser::UTF8)
emitter.start_document([1, 1], [], false)
emitter.start_mapping(nil, nil, false, Psych::Nodes::Mapping::BLOCK)
emitter.scalar("a", nil, nil, true, false, Psych::Nodes::Scalar::PLAIN)
emit...

Psych.dump(o, io, options = {}) -> () (64.0)

Ruby のオブジェクト o を YAML ドキュメントに変換します。

...[例][ruby]{
# Dump an array, get back a YAML string
Psych
.dump(['a', 'b']) # => "---\n- a\n- b\n"

# Dump an array to an IO object
Psych
.dump(['a', 'b'], StringIO.new) # => #<StringIO:0x000001009d0890>

# Dump an array with indentation set
Psych
.dump(['a', ['b']], :indentation => 3) # => "---\n-...
...a\n- - b\n"

# Dump an array to an IO with indentation set
Psych
.dump(['a', ['b']], StringIO.new, :indentation => 3)
//}...