Class for representing WebDAV method MKCOL:
require 'net/http' uri = URI('http://example.com') hostname = uri.hostname # => "example.com" req = Net::HTTP::Mkcol.new(uri) # => #<Net::HTTP::Mkcol MKCOL> res = Net::HTTP.start(hostname) do |http| http.request(req) end
See Request Headers.
Related:
Net::HTTP#mkcol
: sends MKCOL
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.
Switch
that can omit argument.
When we’ve parsed the source, we have both the syntax tree and the list of comments that we found in the source. This class is responsible for walking the tree and finding the nearest location to attach each comment.
It does this by first finding the nearest locations to each comment. Locations can either come from nodes directly or from location fields on nodes. For example, a ‘ClassNode` has an overall location encompassing the entire class, but it also has a location for the `class` keyword.
Once the nearest locations are found, it determines which one to attach to. If it’s a trailing comment (a comment on the same line as other source code), it will favor attaching to the nearest location that occurs before the comment. Otherwise it will favor attaching to the nearest location that is after the comment.
An optional node field represents a single child node in the syntax tree that may or may not be present. It resolves to either a Prism::Node
or nil in Ruby.
A node list field represents a list of child nodes in the syntax tree. It resolves to an array of Prism::Node
instances in Ruby.
A string field represents a string value on a node. It almost always represents the unescaped value of a string-like literal. It resolves to a string in Ruby.
A location field represents the location of some part of the node in the source code. For example, the location of a keyword or an operator. It resolves to a Prism::Location
in Ruby.
A source that is represented by a string.
A field representing the start and end code unit offsets.
An abstract field used as the parent class of the two comments fields.
A field representing the leading comments.
A field representing the trailing comments.
Indicates that the DNS
response was unable to be decoded.
Indicates that the DNS
request was unable to be encoded.