This method must be overridden by subclasses and should return the object method calls are being delegated to.
This method must be overridden by subclasses and change the object delegate to obj.
:method: freeze Freeze both the object returned by _getobj_ and self.
Returns the current object method calls are being delegated to.
Changes the delegate object to obj.
It’s important to note that this does not cause SimpleDelegator’s methods to change. Because of this, you probably only want to change delegation to objects of the same type as the original delegate.
Here’s an example of changing the delegation object.
names = SimpleDelegator.new(%w{James Edward Gray II}) puts names[1] # => Edward names.__setobj__(%w{Gavin Sinclair}) puts names[1] # => Sinclair
Executes the generated ERB
code to produce a completed template, returning the results of that code. (See ERB::new
for details on how this process can be affected by safe_level.)
b accepts a Binding
object which is used to set the context of code evaluation.
Sets the ordering; see Ordering; returns the new ordering.
If the given ordering
is PERMUTE
and environment variable POSIXLY_CORRECT
is defined, sets the ordering to REQUIRE_ORDER
; otherwise sets the ordering to ordering
:
options = GetoptLong.new options.ordering == GetoptLong::PERMUTE # => true options.ordering = GetoptLong::RETURN_IN_ORDER options.ordering == GetoptLong::RETURN_IN_ORDER # => true ENV['POSIXLY_CORRECT'] = 'true' options.ordering = GetoptLong::PERMUTE options.ordering == GetoptLong::REQUIRE_ORDER # => true
Raises an exception if ordering
is invalid.
Convert a network byte ordered string form of an IP address into human readable form.
Returns the integer representation of the ipaddr.
Returns a string containing the IP address representation.
Returns a network byte ordered string form of the IP address.
Returns a string for DNS reverse lookup. It returns a string in RFC3172 form for an IPv6 address.
Returns the prefix length in bits for the ipaddr.
Sets the prefix length in bits
Returns the bound receiver of the binding object.
Returns true
if the log level allows entries with severity Logger::ERROR to be written, false
otherwise. See Log Level.
Sets the log level to Logger::ERROR. See Log Level.
Sets the logger’s output stream:
If logdev
is nil
, reopens the current output stream.
If logdev
is a filepath, opens the indicated file for append.
If logdev
is an IO
stream (usually $stdout
, $stderr
, or an open File
object), opens the stream for append.
Example:
logger = Logger.new('t.log') logger.add(Logger::ERROR, 'one') logger.close logger.add(Logger::ERROR, 'two') # Prints 'log writing failed. closed stream' logger.reopen logger.add(Logger::ERROR, 'three') logger.close File.readlines('t.log') # => # ["# Logfile created on 2022-05-12 14:21:19 -0500 by logger.rb/v1.5.0\n", # "E, [2022-05-12T14:21:27.596726 #22428] ERROR -- : one\n", # "E, [2022-05-12T14:23:05.847241 #22428] ERROR -- : three\n"]
Equivalent to calling add
with severity Logger::ERROR
.
Directs to reject specified class argument.
t
Argument class specifier, any object including Class
.
reject(t)
Release code