Returns the exponent of the BigDecimal
number, as an Integer
.
If the number can be represented as 0.xxxxxx*10**n where xxxxxx is a string of digits with no leading zeros, then n is the exponent.
Returns nil, -1, or +1 depending on whether the value is finite, -Infinity, or +Infinity.
Returns True if the value is finite (not NaN or infinite).
Returns the calendar week based year.
Date.new(2001,2,3).cwyear #=> 2001 Date.new(2000,1,1).cwyear #=> 1999
Returns true if the date is Monday.
This method is equivalent to new_start
(Date::ITALY
).
Returns the month of the year (1..12) for time.
t = Time.now #=> 2007-11-19 08:27:30 -0600 t.mon #=> 11 t.month #=> 11
Returns the month of the year (1..12) for time.
t = Time.now #=> 2007-11-19 08:27:30 -0600 t.mon #=> 11 t.month #=> 11
Returns the year for time (including the century).
t = Time.now #=> 2007-11-19 08:27:51 -0600 t.year #=> 2007
Returns the name of the time zone used for time. As of Ruby 1.8, returns “UTC” rather than “GMT” for UTC times.
t = Time.gm(2000, "jan", 1, 20, 15, 1) t.zone #=> "UTC" t = Time.local(2000, "jan", 1, 20, 15, 1) t.zone #=> "CST"
Returns true
if time represents Monday.
t = Time.local(2003, 8, 4) #=> 2003-08-04 00:00:00 -0500 p t.monday? #=> true
Deletes all data from the database.
Returns a Hash
(not a DBM
database) created by using each value in the database as a key, with the corresponding key as its value.
Flushes input and output buffers in kernel.
You must require ‘io/console’ to use this method.
Reads and returns a line without echo back. Prints prompt
unless it is nil
.
You must require ‘io/console’ to use this method.
Returns an File
instance opened console.
If sym
is given, it will be sent to the opened console with args
and the result will be returned instead of the console IO
itself.
You must require ‘io/console’ to use this method.
Returns true
if an IO
object is in non-blocking mode.
Enables non-blocking mode on a stream when set to true
, and blocking mode when set to false
.
Yields self
in non-blocking mode.
When false
is given as an argument, self
is yielded in blocking mode. The original mode is restored after the block is executed.
Waits until IO
is readable without blocking and returns self
, or nil
when times out. Returns true
immediately when buffered data is available.