Results for: "partition"

This method is equivalent to d >> n.

See Date#>> for examples.

This method is equivalent to d << n.

See Date#<< for examples.

This method is equivalent to d >> (n * 12).

Date.new(2001,2,3).next_year      #=> #<Date: 2002-02-03 ...>
Date.new(2008,2,29).next_year     #=> #<Date: 2009-02-28 ...>
Date.new(2008,2,29).next_year(4)  #=> #<Date: 2012-02-29 ...>

See also Date#>>.

This method is equivalent to d << (n * 12).

Date.new(2001,2,3).prev_year      #=> #<Date: 2000-02-03 ...>
Date.new(2008,2,29).prev_year     #=> #<Date: 2007-02-28 ...>
Date.new(2008,2,29).prev_year(4)  #=> #<Date: 2004-02-29 ...>

See also Date#<<.

Deserializes JSON string by converting Julian year y, month m, day d and Day of Calendar Reform sg to Date.

Returns a hash, that will be turned into a JSON object and represent this object.

Stores class name (Date) with Julian year y, month m, day d and Day of Calendar Reform sg as JSON string

Deserializes JSON string by converting year y, month m, day d, hour H, minute M, second S, offset of and Day of Calendar Reform sg to DateTime.

Returns a hash, that will be turned into a JSON object and represent this object.

Stores class name (DateTime) with Julian year y, month m, day d, hour H, minute M, second S, offset of and Day of Calendar Reform sg as JSON string

Deserializes JSON string by converting time since epoch to Time

Returns a hash, that will be turned into a JSON object and represent this object.

Stores class name (Time) with number of seconds since epoch and number of microseconds for Time as JSON string

Return the number of seconds the specified time zone differs from UTC.

Numeric time zones that include minutes, such as -10:00 or +1330 will work, as will simpler hour-only time zones like -10 or +13.

Textual time zones listed in ZoneOffset are also supported.

If the time zone does not match any of the above, zone_offset will check if the local time zone (both with and without potential Daylight Saving Time changes being in effect) matches zone. Specifying a value for year will change the year used to find the local time zone.

If zone_offset is unable to determine the offset, nil will be returned.

require 'time'

Time.zone_offset("EST") #=> -18000

You must require ‘time’ to use this method.

No documentation available
No documentation available
No documentation available

Calls the block once for each [key, value] pair in the database. Returns self.

Deserializes JSON string by constructing new Struct object with values v serialized by to_json.

Returns a hash, that will be turned into a JSON object and represent this object.

Stores class name (Struct) with Struct values v as a JSON string. Only named structs are supported.

Yields the name and value of each struct member in order. If no block is given an enumerator is returned.

Customer = Struct.new(:name, :address, :zip)
joe = Customer.new("Joe Smith", "123 Maple, Anytown NC", 12345)
joe.each_pair {|name, value| puts("#{name} => #{value}") }

Produces:

name => Joe Smith
address => 123 Maple, Anytown NC
zip => 12345

Waits until IO is readable without blocking and returns self, or nil when times out. Returns true immediately when buffered data is available.

Calls the given block once for each character in ios, passing the character as an argument. The stream must be opened for reading or an IOError will be raised.

If no block is given, an enumerator is returned instead.

f = File.new("testfile")
f.each_char {|c| print c, ' ' }   #=> #<File:testfile>

Returns ios.

Search took: 5ms  ·  Total Results: 3090