# frozen_string_literal: true
module Psych
module Streaming
module ClassMethods
###
# Create a new streaming emitter. Emitter will print to +io+. See
# Psych::Stream for an example.
def new io
emitter = const_get(:Emitter).new(io)
class_loader = ClassLoader.new
ss = ScalarScanner.new class_loader
super(emitter, ss, {})
end
end
###
# Start streaming using +encoding+
def start encoding = Nodes::Stream::UTF8
super.tap { yield self if block_given? }
ensure
finish if block_given?
end
private
def register target, obj
end
end
end
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| handlers | Folder | 0755 |
|
|
| json | Folder | 0755 |
|
|
| nodes | Folder | 0755 |
|
|
| visitors | Folder | 0755 |
|
|
| class_loader.rb | File | 1.99 KB | 0644 |
|
| coder.rb | File | 2.05 KB | 0644 |
|
| core_ext.rb | File | 362 B | 0644 |
|
| exception.rb | File | 726 B | 0644 |
|
| handler.rb | File | 7.2 KB | 0644 |
|
| nodes.rb | File | 2.38 KB | 0644 |
|
| omap.rb | File | 75 B | 0644 |
|
| parser.rb | File | 2.03 KB | 0644 |
|
| scalar_scanner.rb | File | 4.69 KB | 0644 |
|
| set.rb | File | 74 B | 0644 |
|
| stream.rb | File | 923 B | 0644 |
|
| streaming.rb | File | 667 B | 0644 |
|
| syntax_error.rb | File | 588 B | 0644 |
|
| tree_builder.rb | File | 2.99 KB | 0644 |
|
| versions.rb | File | 188 B | 0644 |
|
| visitors.rb | File | 254 B | 0644 |
|
| y.rb | File | 190 B | 0644 |
|