Class: Psych::Stream
Relationships & Source Files | |
Super Chains via Extension / Inclusion / Inheritance | |
Class Chain:
|
|
Instance Chain:
|
|
Inherits: |
Psych::Visitors::YAMLTree
|
Defined in: | ext/psych/lib/psych/stream.rb |
Overview
Stream
is a streaming YAML emitter. It will not buffer your YAML, but send it straight to an IO.
Here is an example use:
stream = Psych::Stream.new($stdout)
stream.start
stream.push({:foo => 'bar'})
stream.finish
YAML will be immediately emitted to $stdout with no buffering.
Psych::Stream#start
will take a block and ensure that Psych::Stream#finish
is called, so you can do this form:
stream = Psych::Stream.new($stdout)
stream.start do |em|
em.push(:foo => 'bar')
end
Constant Summary
Class Method Summary
Streaming::ClassMethods - Extended
new | Create a new streaming emitter. |
Visitors::YAMLTree - Inherited
Instance Attribute Summary
Visitors::YAMLTree - Inherited
#finished? | Alias for Visitors::YAMLTree#finished. |
#started? | Alias for Visitors::YAMLTree#started. |
Instance Method Summary
Streaming - Included
Visitors::YAMLTree - Inherited
#<< | Alias for Visitors::YAMLTree#push. |
#accept, #finish, #finished, #initialize, #push, #start, #started, #tree, #visit_Array, #visit_BasicObject, #visit_BigDecimal, #visit_Class, #visit_Complex, | |
#visit_Date | Alias for Visitors::YAMLTree#visit_Integer. |
#visit_DateTime, #visit_Encoding, #visit_Exception, | |
#visit_FalseClass | Alias for Visitors::YAMLTree#visit_Integer. |
#visit_Float, #visit_Hash, #visit_Integer, #visit_Module, #visit_NameError, #visit_NilClass, #visit_Object, #visit_Psych_Omap, #visit_Psych_Set, #visit_Range, #visit_Rational, #visit_Regexp, #visit_String, #visit_Struct, #visit_Symbol, #visit_Time, | |
#visit_TrueClass | Alias for Visitors::YAMLTree#visit_Integer. |
#binary?, #dump_coder, #dump_ivars, #dump_list, #emit_coder, | |
#find_ivars | FIXME: remove this method once “to_yaml_properties” is removed. |
#format_time, | |
#private_iv_get | Get the private instance variable |
#register, #visit_array_subclass, #visit_hash_subclass |
Visitors::Visitor - Inherited
Constructor Details
This class inherits a constructor from Psych::Visitors::YAMLTree