Like Net::HTTP.get
, but writes the returned body to $stdout; returns nil
.
Sets the continue timeout value, which is the number of seconds to wait for an expected 100 Continue response. If the HTTP object does not receive a response in this many seconds it sends the request body.
true if the response has a body.
Sets the encoding that should be used when reading the body:
If the given value is an Encoding
object, that encoding will be used.
Otherwise if the value is a string, the value of Encoding#find(value) will be used.
Otherwise an encoding will be deduced from the body itself.
Examples:
http = Net::HTTP.new(hostname) req = Net::HTTP::Get.new('/') http.request(req) do |res| p res.body.encoding # => #<Encoding:ASCII-8BIT> end http.request(req) do |res| res.body_encoding = "UTF-8" p res.body.encoding # => #<Encoding:UTF-8> end
Compose a header for the given node.
Compose a string representing the given inner location field.
Returns all of the lines of the source code associated with this node.
An alias for source_lines
, used to mimic the API from RubyVM::AbstractSyntaxTree
to make it easier to migrate.
Slice the location of the node from the source, starting at the beginning of the line that the location starts on, ending at the end of the line that the location ends on.
Similar to inspect, but respects the current level of indentation given by the pretty print object.
def contains_keywords?: () -> bool
Represents the optional source location for the opening token.
[1,2,3] # "[" %w[foo bar baz] # "%w[" %I(apple orange banana) # "%I(" foo = 1, 2, 3 # nil
Represents the optional source location for the closing token.
[1,2,3] # "]" %w[foo bar baz] # "]" %I(apple orange banana) # ")" foo = 1, 2, 3 # nil
def contains_splat?: () -> bool
attr_reader opening_loc
: Location
?
attr_reader closing_loc
: Location
?
def begin_keyword
: () -> String
?