Returns the class for the given object
.
class A def foo ObjectSpace::trace_object_allocations do obj = Object.new p "#{ObjectSpace::allocation_class_path(obj)}" end end end A.new.foo #=> "Class"
See ::trace_object_allocations
for more information and examples.
Returns the size of memory allocated by malloc().
Only available if ruby was built with CALC_EXACT_MALLOC_SIZE
.
Deduce Ruby’s –program-prefix and –program-suffix from its install name
Should be implemented by a extended class.
tsort_each_child
is used to iterate for child nodes of node.
Returns a new lazy enumerator with the concatenated results of running block once for every element in lazy.
["foo", "bar"].lazy.flat_map {|i| i.each_char.lazy}.force #=> ["f", "o", "o", "b", "a", "r"]
A value x returned by block is decomposed if either of the following conditions is true:
a) <i>x</i> responds to both each and force, which means that <i>x</i> is a lazy enumerator. b) <i>x</i> is an array or responds to to_ary.
Otherwise, x is contained as-is in the return value.
[{a:1}, {b:2}].lazy.flat_map {|i| i}.force #=> [{:a=>1}, {:b=>2}]
See Zlib::GzipReader
documentation for a description.
Iterate all direct child instruction sequences. Iteration order is implementation/version defined so that people should not rely on the order.
Returns the eigenvector matrix V
Returns the block diagonal eigenvalue matrix D
Similar to fetch()
, but set
contains unique identifiers.
Yields each message to the passed-in block in turn. Equivalent to:
pop3.mails.each do |popmail| .... end
This method raises a POPError
if an error occurs.
Main name of the switch.
Iterates over the attributes of an Element
. Yields actual Attribute
nodes, not String values.
doc = Document.new '<a x="1" y="2"/>' doc.root.attributes.each_attribute {|attr| p attr.expanded_name+" => "+attr.value }
Defaults to use Ruby’s program prefix and suffix.
This is ported over from the yaml_tree in 1.9.3
File
Fetcher. Dispatched by fetch_path
. Use it instead.
HTTP Fetcher. Dispatched by fetch_path
. Use it instead.
Returns the size of uri
in bytes.