Execute the provided block, but preserve the rounding mode
BigDecimal.save_rounding_mode do BigDecimal.mode(BigDecimal::ROUND_MODE, :up) puts BigDecimal.mode(BigDecimal::ROUND_MODE) end
For use with the BigDecimal::ROUND_*
See BigDecimal.mode
Invoked as a callback whenever a singleton method is added to the receiver.
module Chatty def Chatty.singleton_method_added(id) puts "Adding #{id.id2name}" end def self.one() end def two() end def Chatty.three() end end
produces:
Adding singleton_method_added Adding one Adding three
Specifies VI editing mode. See the manual of GNU Readline
for details of VI editing mode.
Raises NotImplementedError
if the using readline library does not support.
Returns true if vi mode is active. Returns false if not.
Raises NotImplementedError
if the using readline library does not support.
Specifies Emacs editing mode. The default is this mode. See the manual of GNU Readline
for details of Emacs editing mode.
Raises NotImplementedError
if the using readline library does not support.
Returns true if emacs mode is active. Returns false if not.
Raises NotImplementedError
if the using readline library does not support.
Returns reference counter of Dispatch interface of WIN32OLE
object. You should not use this method because this method exists only for debugging WIN32OLE
.
Counts objects for each T_IMEMO
type.
This method is only for MRI developers interested in performance and memory usage of Ruby programs.
It returns a hash as:
{:imemo_ifunc=>8, :imemo_svar=>7, :imemo_cref=>509, :imemo_memo=>1, :imemo_throw_data=>1}
If the optional argument, result_hash, is given, it is overwritten and returned. This is intended to avoid probe effect.
The contents of the returned hash is implementation specific and may change in the future.
In this version, keys are symbol objects.
This method is only expected to work with C Ruby.
Add the –prerelease option to the option parser.
Sends a SELECT command to select a mailbox
so that messages in the mailbox
can be accessed.
After you have selected a mailbox, you may retrieve the number of items in that mailbox from @responses[-1], and the number of recent messages from @responses[-1]. Note that these values can change if new messages arrive during a session; see add_response_handler()
for a way of detecting this event.
A Net::IMAP::NoResponseError
is raised if the mailbox does not exist or is for some reason non-selectable.
@return the XMLDecl
encoding of this document as an Encoding
object. If no XMLDecl
has been set, returns the default encoding.
Inherited from Encoding
Overridden to support optimized en/decoding
Returns the canceled status.
Selects specified components from URI
require 'uri' uri = URI.parse('http://myuser:mypass@my.example.com/test.rbx') p uri.select(:userinfo, :host, :path) # => ["myuser:mypass", "my.example.com", "/test.rbx"]
Mounts servlet
on dir
passing options
to the servlet at creation time
Returns the base64 encoded internal string.
Encodes string str
with base64 and returns that value.
You can use this method to execute several methods on a XMLRPC
server which support the multi-call extension.
s.multicall( ['michael.add', 3, 4], ['michael.sub', 4, 5] ) # => [7, -1]