method
make_stream
ruby latest stable - Class:
YAML
Method deprecated or moved
This method is deprecated or moved on the latest stable version. The last existing version (v1_9_1_378) is shown here.
make_stream( io )public
Class method for creating streams
# File lib/yaml/stringio.rb, line 55
def YAML.make_stream( io )
if String === io
io = StringIO.new( io )
elsif not IO === io
raise YAML::Error, "YAML stream must be an IO or String object."
end
if YAML::unicode
def io.readline
YAML.utf_to_internal( readline( @ln_sep ), @utf_encoding )
end
def io.check_unicode
@utf_encoding = YAML.sniff_encoding( read( 4 ) )
@ln_sep = YAML.enc_separator( @utf_encoding )
seek( -4, IO::SEEK_CUR )
end
def io.utf_encoding
@utf_encoding
end
io.check_unicode
else
def io.utf_encoding
:None
end
end
io
end Related methods
- Class methods
- add_builtin_type
- add_domain_type
- add_private_type
- add_ruby_type
- detect_implicit
- dump
- dump_stream
- each_document
- each_node
- emitter
- escape
- generic_parser
- load
- load_documents
- load_file
- load_stream
- make_stream
- object_maker
- parse
- parse_documents
- parse_file
- parser
- quick_emit
- read_type_class
- resolver
- tag_class
- tagged_classes
- tagurize
- transfer
- try_implicit
- unescape