Results for: "tally"

The buffer is external if it references the memory which is not allocated or mapped by the buffer itself.

A buffer created using ::for has an external reference to the string’s memory.

External buffer can’t be resized.

If the buffer is internal, meaning it references memory allocated by the buffer itself.

An internal buffer is not associated with any external memory (e.g. string) or file mapping.

Internal buffers are created using ::new and is the default when the requested size is less than the IO::Buffer::PAGE_SIZE and it was not requested to be mapped on creation.

Internal buffers can be resized, and such an operation will typically invalidate all slices, but not always.

If the buffer is read only, meaning the buffer cannot be modified using set_value, set_string or copy and similar.

Frozen strings and read-only files create read-only buffers.

Returns an array of values of buffer_type starting from offset.

If count is given, only count values will be returned.

IO::Buffer.for("Hello World").values(:U8, 2, 2)
# => [108, 108]

Evaluates the instruction sequence and returns the result.

RubyVM::InstructionSequence.compile("1 + 2").eval #=> 3

Returns the value or list of values for this cookie.

Replaces the value of this cookie with a new value or list of values.

Set whether the Cookie is a httponly cookie or not.

val must be a boolean.

No documentation available

Creates a new Net::HTTP object, http, via Net::HTTP.new:

With no block given:

With a block given:

Example:

hostname = 'jsonplaceholder.typicode.com'
Net::HTTP.start(hostname) do |http|
  puts http.get('/todos/1').body
  puts http.get('/todos/2').body
end

Output:

{
  "userId": 1,
  "id": 1,
  "title": "delectus aut autem",
  "completed": false
}
{
  "userId": 1,
  "id": 2,
  "title": "quis ut nam facilis et officia qui",
  "completed": false
}

If the last argument given is a hash, it is the opts hash, where each key is a method or accessor to be called, and its value is the value to be set.

The keys may include:

Note: If port is nil and opts[:use_ssl] is a truthy value, the value passed to new is Net::HTTP.https_default_port, not port.

Returns true if the HTTP session has been started:

http = Net::HTTP.new(hostname)
http.started? # => false
http.start
http.started? # => true
http.finish # => nil
http.started? # => false

Net::HTTP.start(hostname) do |http|
  http.started?
end # => true
http.started? # => false

Starts an HTTP session.

Without a block, returns self:

http = Net::HTTP.new(hostname)
# => #<Net::HTTP jsonplaceholder.typicode.com:80 open=false>
http.start
# => #<Net::HTTP jsonplaceholder.typicode.com:80 open=true>
http.started? # => true
http.finish

With a block, calls the block with self, finishes the session when the block exits, and returns the block’s value:

http.start do |http|
  http
end
# => #<Net::HTTP jsonplaceholder.typicode.com:80 open=false>
http.started? # => false

Raises an HTTP error if the response is not 2xx (success).

def equal: () -> String?

Returns the value of the node as a Ruby Complex.

def decimal?: () -> bool

def hexadecimal?: () -> bool

def mutable?: () -> bool

Returns the value of the node as a Ruby Rational.

def literal?: () -> bool

def mutable?: () -> bool

def mutable?: () -> bool

def value: () -> String?

Returns the value of the magic comment by slicing it from the source code.

No documentation available
Search took: 3ms  ·  Total Results: 1835