るりまサーチ (Ruby 2.1.0)

最速Rubyリファレンスマニュアル検索!
53件ヒット [1-53件を表示] (0.042秒)
トップページ > クエリ:-[x] > バージョン:2.1.0[x] > ライブラリ:psych[x] > クエリ:new[x]

別のキーワード

  1. _builtin -
  2. open-uri open
  3. irb/input-method new
  4. irb/input-method gets
  5. matrix -

検索結果

Psych::Visitors::YAMLTree.new(options = {}, emitter = Psych::TreeBuilder.new, ss = Psych::ScalarScanner.new) -> Psych::Visitors::YAMLTree (55216.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::Parser.new(handler = Handler.new) -> Psych::Parser (54913.0)

新たなパーサオブジェクトを生成して返します。

...新たなパーサオブジェクトを生成して返します。

handler で YAML のイベントを処理するハンドラを指定します。
詳しくは Psych::Parser を参照してください。

@param handler YAML のイベントを処理するハンドラ...

Psych::Nodes::Document.new(version=[], tag_directives=[], implicit=false) -> Psych::Nodes::Document (54628.0)

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

...YAML 1.1 のドキュメントで、
tag directive を1つ持ち、 implicit にドキュメントが開始
している Document オブジェクトを生成しています。

Psych
::Nodes::Document.new(
[1,1],
tenderlovemaking.com,2009:",
true)

@see Psych::Handler#start_document...

Psych::Emitter.new(io) -> Psych::Emitter (54610.0)

Emitter オブジェクトを生成して返します。

Emitter オブジェクトを生成して返します。

@param io 出力先の IO オブジェクト

Psych::Nodes::Alias.new(anchor) -> Psych::Nodes::Alias (54610.0)

新たな Alias オブジェクトを生成します。

新たな Alias オブジェクトを生成します。

anchor で指す先の anchor を指定します。

@param anchor 指す先の anchor

絞り込み条件を変える

Psych::Nodes::Mapping.new(anchor=nil, tag=nil, implicit=true, style=BLOCK) -> Psych::Nodes::Mapping (54610.0)

新たな mapping オブジェクトを生成します。

...AML ドキュメント上の style を整数で指定します。以下のいずれ
かを指定できます。
* Psych::Nodes::Mapping::ANY
* Psych::Nodes::Mapping::BLOCK
* Psych::Nodes::Mapping::FLOW

@param anchor mapping に付加された anchor
@param tag mapping に付加された tag
@...

Psych::Nodes::Scalar.new(value, anchor=nil, tag=nil, plain=true, quoted=false, style=ANY) -> Psych::Nodes:Scalar (54610.0)

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

...します。
style は次の値のいずれかです。
* Psych::Nodes::Scalar::ANY
* Psych::Nodes::Scalar::PLAIN
* Psych::Nodes::Scalar::SINGLE_QUOTED
* Psych::Nodes::Scalar::DOUBLE_QUOTED
* Psych::Nodes::Scalar::LITERAL
* Psych::Nodes::Scalar::FOLDED

@param value スカラー値
@para...

Psych::Nodes::Sequence.new(anchor=nil, tag=nil, implicit=true, style=BLOCK) -> Psych::Nodes::Sequence (54610.0)

新たな sequence オブジェクトを生成します。

...ML ドキュメント上の style を整数で指定します。以下のいずれ
かを指定できます。
* Psych::Nodes::Sequence::ANY
* Psych::Nodes::Sequence::BLOCK
* Psych::Nodes::Sequence::FLOW

@param anchor sequence に付加された anchor
@param tag sequence に付加された t...

Psych::Nodes::Stream.new(encoding = Psych::Nodes::Stream::UTF8) -> Psych::Nodes::Stream (54610.0)

Psych::Nodes::Stream オブジェクトを生成して返します。

...
Psych
::Nodes::Stream オブジェクトを生成して返します。

encoding には stream に使われるエンコーディングを指定します。
以下のいずれかを指定します。
* Psych::Nodes::Node::UTF8
* Psych::Nodes::Node::UTF16BE
* Psych::Nodes::Node::UTF16LE

@param...

Psych::Stream.new(io) -> Psych::Stream (54610.0)

新たな Stream オブジェクトを生成します。

新たな Stream オブジェクトを生成します。

io で YAML document の出力先を指定します。

@param io 出力先の IO オブジェクト

絞り込み条件を変える

Psych::TreeBuilder.new -> Psych::TreeBuilder (54610.0)

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

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

Psych.dump(o, io, options = {}) -> () (433.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.dump(o, options = {}) -> String (433.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)
//}...

Object.yaml_tag(tag) -> () (343.0)

クラスと tag の間を関連付けます。

...g 対象のクラスに関連付けるタグの文字列

=== Example
require 'psych'

class Foo
def initialize(x)
@x = x
end

attr_reader :x
end

# Dumps Ruby object normally
p Psych.dump(Foo.new(3))
# =>
# --- !ruby/object:Foo
# x: 3

# Registers tag...
...yaml_as("tag:example.com,2013:foo")
# ... and dumps the object of Foo class
Psych
.dump(Foo.new(3), STDOUT)
# =>
# --- !<tag:example.com,2013:foo>
# x: 3

# Loads the object from the tagged YAML node
p Psych.load(<<EOS)
--- !<tag:example.com,2012:foo>
x: 8
EOS
# => #<Foo:0x00...

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

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

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

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

絞り込み条件を変える

Psych::Nodes::Document#implicit -> bool (325.0)

ドキュメントが implicit に始まっているかどうかを返します。

...ドキュメントが implicit に始まっているかどうかを返します。

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

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

tag directive の配列を返します。

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

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

Psych::Nodes::Document#version -> [Integer] (325.0)

YAML ドキュメントのバージョンを返します。

...YAML ドキュメントのバージョンを返します。

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

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

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

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

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

Psych::Nodes::Mapping#implicit -> bool (325.0)

mapping が implicit に開始されたかどうかを真偽値で返します。

...mapping が implicit に開始されたかどうかを真偽値で返します。

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

絞り込み条件を変える

Psych::Nodes::Mapping#style -> Integer (325.0)

mapping の style を返します。

...mapping の style を返します。

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

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

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

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

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

Psych::Nodes::Mapping::ANY -> Integer (325.0)

「任意」のスタイルを意味します。

...「任意」のスタイルを意味します。

emitter が適当に style を決めます。

@see Psych::Nodes::Mapping.new,
Psych
::Nodes::Mapping#style,
Psych
::Handler#start_mapping...

Psych::Nodes::Mapping::BLOCK -> Integer (325.0)

block style を表します。

...block style を表します。

@see Psych::Nodes::Mapping.new,
Psych
::Nodes::Mapping#style,
Psych
::Handler#start_mapping...

Psych::Nodes::Mapping::FLOW -> Integer (325.0)

flow style を表します。

...flow style を表します。

@see Psych::Nodes::Mapping.new,
Psych
::Nodes::Mapping#style,
Psych
::Handler#start_mapping...

絞り込み条件を変える

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

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

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

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

Psych::Nodes::Scalar#plain -> bool (325.0)

scalar が plain style であるかどうかを返します。

...scalar が plain style であるかどうかを返します。


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

Psych::Nodes::Scalar#quoted -> bool (325.0)

scalar が quoted であるかどうかを返します。

...scalar が quoted であるかどうかを返します。

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

Psych::Nodes::Scalar#style -> Integer (325.0)

scalar の style を返します。

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

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

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

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

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

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

絞り込み条件を変える

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

scalar の値を返します。

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

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

Psych::Nodes::Scalar::ANY -> Integer (325.0)

「任意」のスタイルを意味します。

...「任意」のスタイルを意味します。

emitter が適当に style を決めます。

@see Psych::Nodes::Scalar.new,
Psych
::Nodes::Scalar#style...

Psych::Nodes::Scalar::DOUBLE_QUOTED -> Integer (325.0)

double quoted style を表します。

...double quoted style を表します。

@see Psych::Nodes::Scalar.new,
Psych
::Nodes::Scalar#style,
Psych
::Handler#scalar...

Psych::Nodes::Scalar::FOLDED -> Integer (325.0)

folded style を表します。

...folded style を表します。

@see Psych::Nodes::Scalar.new,
Psych
::Nodes::Scalar#style,
Psych
::Handler#scalar...

Psych::Nodes::Scalar::LITERAL -> Integer (325.0)

literal style を表します。

...literal style を表します。

@see Psych::Nodes::Scalar.new,
Psych
::Nodes::Scalar#style,
Psych
::Handler#scalar...

絞り込み条件を変える

Psych::Nodes::Scalar::PLAIN -> Integer (325.0)

plain scalar style を表します。

...plain scalar style を表します。

@see Psych::Nodes::Scalar.new,
Psych
::Nodes::Scalar#style,
Psych
::Handler#scalar...

Psych::Nodes::Scalar::SINGLE_QUOTED -> Integer (325.0)

single quoted style を表します。

...single quoted style を表します。

@see Psych::Nodes::Scalar.new,
Psych
::Nodes::Scalar#style,
Psych
::Handler#scalar...

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

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

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

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

Psych::Nodes::Sequence#implicit -> bool (325.0)

sequence が implicit に開始されたかどうかを真偽値で返します。

...sequence が implicit に開始されたかどうかを真偽値で返します。

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

Psych::Nodes::Sequence#style -> Integer (325.0)

sequence の style を返します。

...sequence の style を返します。

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

絞り込み条件を変える

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

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

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

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

Psych::Nodes::Sequence::ANY -> Integer (325.0)

「任意」のスタイルを意味します。

...「任意」のスタイルを意味します。

emitter が適当に style を決めます。

@see Psych::Nodes::Sequence.new,
Psych
::Nodes::Sequence#style,
Psych
::Handler#start_sequence...

Psych::Nodes::Sequence::BLOCK -> Integer (325.0)

block style を表します。

...block style を表します。

@see Psych::Nodes::Sequence.new,
Psych
::Nodes::Sequence#style,
Psych
::Handler#start_sequence...

Psych::Nodes::Sequence::FLOW -> Integer (325.0)

flow style を表します。

...flow style を表します。

@see Psych::Nodes::Sequence.new,
Psych
::Nodes::Sequence#style...

Psych::Nodes::Stream::UTF16BE -> Integer (325.0)

UTF16BE エンコーディングを表します。

...UTF16BE エンコーディングを表します。

Psych
::Parser::UTF16BE と同じ値です。

@see Psych::Nodes::Stream.new...

絞り込み条件を変える

Psych::Nodes::Stream::UTF16LE -> Integer (325.0)

UTF16LE エンコーディングを表します。

...UTF16LE エンコーディングを表します。

Psych
::Parser::UTF16LE と同じ値です。

@see Psych::Nodes::Stream.new...

Psych::Nodes::Stream::UTF8 -> Integer (325.0)

UTF8 エンコーディングを表します。

...UTF8 エンコーディングを表します。

Psych
::Parser::UTF8 と同じ値です。

@see Psych::Nodes::Stream.new...

Psych::Parser#parse(yaml) -> self (325.0)

YAML ドキュメントをパースし、イベントハンドラに イベントを逐次通知します。

...YAML ドキュメントをパースし、イベントハンドラに
イベントを逐次通知します。

@see Psych::Parser.new, Psych::Handler, Psych::Parser#handler...

Psych::ScalarScanner#tokenize(string) -> object (325.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::Stream#start(encoding = Psych::Nodes::Stream::UTF8) -> Psych::Stream (325.0)

Ruby オブジェクトを YAML document に変換するための準備をします。

...Ruby オブジェクトを YAML document に変換するための準備をします。

変換された document は Psych::Stream.new で指定した
出力先に出力されます。

finish を呼び出すことで出力が完了します(finish を呼び出さないと
最後まで出力され...

絞り込み条件を変える

Psych::Stream#start(encoding = Psych::Nodes::Stream::UTF8) {|em| ... } -> Psych::Stream (325.0)

Ruby オブジェクトを YAML document に変換するための準備をします。

...Ruby オブジェクトを YAML document に変換するための準備をします。

変換された document は Psych::Stream.new で指定した
出力先に出力されます。

finish を呼び出すことで出力が完了します(finish を呼び出さないと
最後まで出力され...

Psych::Nodes (97.0)

Psych が中間データとして利用している AST (Abstract Syntax Tree) に 関するモジュール。

...Psych が中間データとして利用している AST (Abstract Syntax Tree) に
関するモジュール。

Psych
.load によって YAML ドキュメントを Ruby オブジェクトに変換
するときには、一度中間的な AST に変換され、その AST が Ruby の
オブジェクト...
...

逆向き、つまり Psych.dump で Ruby のオブジェクトを
YAML ドキュメントに変換するときには、中間的な AST に変換してから
それを YAML ドキュメントに変換します。

YAML AST の各ノードのクラスはすべて Psych::Nodes の下にありま...
...を1つ持つリストの AST を構築しています。

# Create our nodes
stream = Psych::Nodes::Stream.new
doc = Psych::Nodes::Document.new
seq = Psych::Nodes::Sequence.new
scalar = Psych::Nodes::Scalar.new('foo')

# Build up our tree
stream.children << doc
doc.children...

Psych::Visitors::YAMLTree (61.0)

Ruby オブジェクトから YAML の AST を構築するためのクラスです。

...クトから YAML の AST を構築するためのクラスです。

=== 例
builder = Psych::Visitors::YAMLTree.new
builder << { :foo => 'bar' }
builder << ["baz", "bazbaz"]
builder.tree # => #<Psych::Nodes::Stream ... > A stream containing two documents
puts tree.to_yaml
# =>
# ---...