Results for: "Array.new"

Refine klass in the receiver.

Returns an overlaid module.

Returns the list of Modules nested at the point of call.

module M1
  module M2
    $a = Module.nesting
  end
end
$a           #=> [M1::M2, M1]
$a[0].name   #=> "M1::M2"

Return the fractional part of the number, as a BigDecimal.

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 the Integer equal to int + 1, same as Fixnum#next.

1.next      #=> 2
(-1).next   #=> 0

Returns self.

Returns the value as a rational. The optional argument eps is always ignored.

Returns the numerator.

Rational(7).numerator        #=> 7
Rational(7, 1).numerator     #=> 7
Rational(9, -4).numerator    #=> -9
Rational(-2, -10).numerator  #=> 1

Returns a simpler approximation of the value if the optional argument eps is given (rat-|eps| <= result <= rat+|eps|), self otherwise.

r = Rational(5033165, 16777216)
r.rationalize                    #=> (5033165/16777216)
r.rationalize(Rational('0.01'))  #=> (3/10)
r.rationalize(Rational('0.1'))   #=> (1/3)

Creates a date object denoting the present day.

Parses the given representation of date and time, and returns a hash of parsed elements. This method does not function as a validator.

If the optional second argument is true and the detected year is in the range “00” to “99”, considers the year a 2-digit form and makes it full.

Date._parse('2001-02-03') #=> {:year=>2001, :mon=>2, :mday=>3}

Parses the given representation of date and time, and creates a date object. This method does not function as a validator.

If the optional second argument is true and the detected year is in the range “00” to “99”, considers the year a 2-digit form and makes it full.

Date.parse('2001-02-03')          #=> #<Date: 2001-02-03 ...>
Date.parse('20010203')            #=> #<Date: 2001-02-03 ...>
Date.parse('3rd Feb 2001')        #=> #<Date: 2001-02-03 ...>

Returns the year.

Date.new(2001,2,3).year           #=> 2001
(Date.new(1,1,1) - 1).year        #=> 0

Returns the day of the year (1-366).

Date.new(2001,2,3).yday           #=> 34

Returns the day of the month (1-31).

Date.new(2001,2,3).mday           #=> 3

Returns the day of the month (1-31).

Date.new(2001,2,3).mday           #=> 3

Returns the calendar week based year.

Date.new(2001,2,3).cwyear         #=> 2001
Date.new(2000,1,1).cwyear         #=> 1999

Returns the day of calendar week (1-7, Monday is 1).

Date.new(2001,2,3).cwday          #=> 6

Returns the day of week (0-6, Sunday is zero).

Date.new(2001,2,3).wday           #=> 6

Returns true if the date is Sunday.

Returns true if the date is Monday.

Returns true if the date is Tuesday.

Returns true if the date is Thursday.

Returns true if the date is Friday.

Returns true if the date is Saturday.

Search took: 5ms  ·  Total Results: 2422