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
Psych::JSON::TreeBuilder
is an event based AST builder. Events are sent to an instance of Psych::JSON::TreeBuilder
and a JSON
AST is constructed.
This class represents a YAML Scalar.
This node type is a terminal node and should not have any children.
This class represents a YAML sequence.
A YAML
sequence is basically a list, and looks like this:
%YAML 1.1 --- - I am - a Sequence
A YAML
sequence may have an anchor like this:
%YAML 1.1 --- &A [ "This sequence", "has an anchor" ]
A YAML
sequence may also have a tag like this:
%YAML 1.1 --- !!seq [ "This sequence", "has a tag" ]
This class represents a sequence in a YAML
document. A Psych::Nodes::Sequence
node may have 0 or more children. Valid children for this node are:
Base class of errors that occur when processing GZIP files.
Raised when gzip file footer is not found.
Raised when the CRC checksum recorded in gzip file footer is not equivalent to the CRC checksum of the actual uncompressed data.
Raised when the data length recorded in the gzip file footer is not equivalent to the length of the actual uncompressed data.
Raised when an operation would resize or re-allocate a locked buffer.
Raised if you try to access a buffer slice which no longer references a valid memory range of the underlying source.
Raised if the mask given to a binary operation is invalid, e.g. zero length or overlaps the target buffer.
Class for representing HTTP method PATCH:
require 'net/http' uri = URI('http://example.com') hostname = uri.hostname # => "example.com" uri.path = '/posts' req = Net::HTTP::Patch.new(uri) # => #<Net::HTTP::Patch PATCH> req.body = '{"title": "foo","body": "bar","userId": 1}' req.content_type = 'application/json' res = Net::HTTP.start(hostname) do |http| http.request(req) end
See Request Headers.
Properties:
Request body: yes.
Response body: yes.
Safe: no.
Idempotent: no.
Cacheable: no.
Related:
Net::HTTP#patch
: sends PATCH
request, returns response object.
Class for representing WebDAV method PROPFIND:
require 'net/http' uri = URI('http://example.com') hostname = uri.hostname # => "example.com" req = Net::HTTP::Propfind.new(uri) # => #<Net::HTTP::Propfind PROPFIND> res = Net::HTTP.start(hostname) do |http| http.request(req) end
See Request Headers.
Related:
Net::HTTP#propfind
: sends PROPFIND
request, returns response object.
Class for representing WebDAV method COPY:
require 'net/http' uri = URI('http://example.com') hostname = uri.hostname # => "example.com" req = Net::HTTP::Copy.new(uri) # => #<Net::HTTP::Copy COPY> res = Net::HTTP.start(hostname) do |http| http.request(req) end
See Request Headers.
Related:
Net::HTTP#copy
: sends COPY
request, returns response object.