Makes a list of existing constants private.
Makes a list of existing constants deprecated. Attempt to refer to them will produce a warning.
module HTTP NotFound = Exception.new NOT_FOUND = NotFound # previous version of the library used this name deprecate_constant :NOT_FOUND end HTTP::NOT_FOUND # warning: constant HTTP::NOT_FOUND is deprecated
Returns true if the given calendar date is valid, and false if not. Valid in this context is whether the arguments passed to this method would be accepted by ::new
.
Date.valid_date?(2001,2,3) #=> true Date.valid_date?(2001,2,29) #=> false Date.valid_date?(2001,2,-1) #=> true
Returns self.
Returns a DateTime
object which denotes self.
Returns a Date
object which denotes self.
Returns self.
Returns a Date
object which denotes self.
Returns a DateTime
object which denotes self.
Returns true if this class can be used to create an instance from a serialised JSON
string. The class has to implement a class method json_create that expects a hash as first parameter. The hash should include the required data.
Returns garbage collector generation for the given object
.
class B include ObjectSpace def foo trace_object_allocations do obj = Object.new p "Generation is #{allocation_generation(obj)}" end end end B.new.foo #=> "Generation is 3"
See ::trace_object_allocations
for more information and examples.
Takes a hash as its argument. The key is a symbol or an array of symbols. These symbols correspond to method names, instance variable names, or constant names (see def_delegator
). The value is the accessor to which the methods will be delegated.
How String
Gem paths should be split. Overridable for esoteric platforms.
Returns the status of the last executed child process in the current thread.
Process.wait Process.spawn("ruby", "-e", "exit 13") Process.last_status #=> #<Process::Status: pid 4825 exit 13>
If no child process has ever been executed in the current thread, this returns nil
.
Process.last_status #=> nil
True if the gems in the system satisfy dependency
.
Downloads uri
to path
if necessary. If no path is given, it just passes the data.
Expire memoized instance variables that can incorrectly generate, replace or miss files due changes in certain attributes used to compute them.