Class: Psych::Handlers::Recorder (Ruby 2.4.2)
Description: Class : Psych::Handlers::Recorder - Ruby 2.4.2

Support for the Ruby 2.4 series has ended. See here for reference.

### Home Classes Methods

### In Files

- psych/lib/psych/handlers/recorder.rb

### Parent

Psych::Handler

### Methods

- ::new

### Class/Module Index

Quicksearch

- Kernel
- Module
- Object
- Psych
- Psych::BadAlias
- Psych::ClassLoader
- Psych::ClassLoader::Restricted
- Psych::Coder
- Psych::DisallowedClass
- Psych::Emitter
- Psych::Exception
- Psych::Handler
- Psych::Handler::DumperOptions
- Psych::Handlers
- Psych::Handlers::Recorder
- Psych::JSON
- Psych::JSON::Stream
- Psych::JSON::TreeBuilder
- Psych::Nodes
- Psych::Nodes::Alias
- Psych::Nodes::Document
- Psych::Nodes::Mapping
- Psych::Nodes::Node
- Psych::Nodes::Scalar
- Psych::Nodes::Sequence
- Psych::Nodes::Stream
- Psych::Omap
- Psych::Parser
- Psych::Parser::Mark
- Psych::ScalarScanner
- Psych::Set
- Psych::Stream
- Psych::Streaming
- Psych::Streaming::ClassMethods
- Psych::SyntaxError
- Psych::TreeBuilder
- Psych::Visitors
- Psych::Visitors::DepthFirst
- Psych::Visitors::Emitter
- Psych::Visitors::JSONTree
- Psych::Visitors::NoAliasRuby
- Psych::Visitors::ToRuby
- Psych::Visitors::Visitor
- Psych::Visitors::YAMLTree
- Regexp

No matching classes.

# Psych::Handlers::Recorder

This handler will capture an event and record the event. `Recorder` events are available vial `Psych::Handlers::Recorder#events`.

For example:

    recorder = Psych::Handlers::Recorder.new
    parser = Psych::Parser.new recorder
    parser.parse '--- foo'

    recorder.events # => [list of events]

    # Replay the events

    emitter = Psych::Emitter.new $stdout
    recorder.events.each do |m, args|
      emitter.send m, *args
    end

### Attributes

events[R]

### Public Class Methods

new() click to toggle source

                   # File psych/lib/psych/handlers/recorder.rb, line 28
    def initialize
      @events = []
      super
    end