Results for: "String# "

No documentation available

Sanitize a single string.

If the SOURCE_DATE_EPOCH environment variable is set, returns it’s value. Otherwise, returns the time that Gem.source_date_epoch_string was first called in the same format as SOURCE_DATE_EPOCH.

NOTE(@duckinator): The implementation is a tad weird because we want to:

1. Make builds reproducible by default, by having this function always
   return the same result during a given run.
2. Allow changing ENV['SOURCE_DATE_EPOCH'] at runtime, since multiple
   tests that set this variable will be run in a single process.

If you simplify this function and a lot of tests fail, that is likely due to #2 above.

Details on SOURCE_DATE_EPOCH: reproducible-builds.org/specs/source-date-epoch/

in “” in “foo”

Concatenates each object in objects into self without any encoding validation or conversion and returns self:

s = 'foo'
s.append_as_bytes(" \xE2\x82")  # => "foo \xE2\x82"
s.valid_encoding?               # => false
s.append_as_bytes("\xAC 12")
s.valid_encoding?               # => true

For each given object object that is an Integer, the value is considered a Byte. If the Integer is bigger than one byte, only the lower byte is considered, similar to String#setbyte:

s = ""
s.append_as_bytes(0, 257)             # =>  "\u0000\u0001"

Related: String#<<, String#concat, which do an encoding aware concatenation.

Returns a status string for the response.

Returns the human readable error string corresponding to the error code retrieved by error.

See also the man page X509_verify_cert_error_string(3).

No documentation available

This method is provided by the Ripper C extension. It is called when a string needs to be dedented because of a tilde heredoc. It is expected that it will modify the string in place and return the number of bytes that were removed.

No documentation available
No documentation available

Visit an individual part of a string-like node.

“foo” ^^^^^

Apply Ruby string escaping rules

“foo #{bar}” ^^^^^^^^^^^^

‘foo` ^^^^^

No documentation available

Visit a heredoc node that is representing a string.

IO streams for strings, with access similar to IO; see IO.

About the Examples

Examples on this page assume that StringIO has been required:

require 'stringio'
No documentation available

Returns the octet string representation of the elliptic curve point.

conversion_form specifies how the point is converted. Possible values are:

“foo” ^^^^^

“foo” ^^^^^

‘foo #{bar}` ^^^^^^^^^^^^

Objects of class Binding encapsulate the execution context at some particular place in the code and retain this context for future use. The variables, methods, value of self, and possibly an iterator block that can be accessed in this context are all retained. Binding objects can be created using Kernel#binding, and are made available to the callback of Kernel#set_trace_func and instances of TracePoint.

These binding objects can be passed as the second argument of the Kernel#eval method, establishing an environment for the evaluation.

class Demo
  def initialize(n)
    @secret = n
  end
  def get_binding
    binding
  end
end

k1 = Demo.new(99)
b1 = k1.get_binding
k2 = Demo.new(-3)
b2 = k2.get_binding

eval("@secret", b1)   #=> 99
eval("@secret", b2)   #=> -3
eval("@secret")       #=> nil

Binding objects have no class-specific methods.

Search took: 2ms  ·  Total Results: 2656