Results for: "OptionParser"

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

No documentation available
No documentation available
No documentation available
No documentation available
No documentation available

Returns the offset in seconds between the timezone of time and UTC.

t = Time.gm(2000,1,1,20,15,1)   #=> 2000-01-01 20:15:01 UTC
t.gmt_offset                    #=> 0
l = t.getlocal                  #=> 2000-01-01 14:15:01 -0600
l.gmt_offset                    #=> -21600

Returns the offset in seconds between the timezone of time and UTC.

t = Time.gm(2000,1,1,20,15,1)   #=> 2000-01-01 20:15:01 UTC
t.gmt_offset                    #=> 0
l = t.getlocal                  #=> 2000-01-01 14:15:01 -0600
l.gmt_offset                    #=> -21600

Returns the value of time as an integer number of seconds since the Epoch.

If time contains subsecond, they are truncated.

t = Time.now        #=> 2020-07-21 01:41:29.746012609 +0900
t.to_i              #=> 1595263289

Returns the number of microseconds for the subsecond part of time. The result is a non-negative integer less than 10**6.

t = Time.now        #=> 2020-07-20 22:05:58.459785953 +0900
t.usec              #=> 459785

If time has fraction of microsecond (such as nanoseconds), it is truncated.

t = Time.new(2000,1,1,0,0,0.666_777_888_999r)
t.usec              #=> 666777

Time#subsec can be used to obtain the subsecond part exactly.

Returns the number of nanoseconds for the subsecond part of time. The result is a non-negative integer less than 10**9.

t = Time.now        #=> 2020-07-20 22:07:10.963933942 +0900
t.nsec              #=> 963933942

If time has fraction of nanosecond (such as picoseconds), it is truncated.

t = Time.new(2000,1,1,0,0,0.666_777_888_999r)
t.nsec              #=> 666777888

Time#subsec can be used to obtain the subsecond part exactly.

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
No documentation available

Returns a data represents the current console mode.

You must require ‘io/console’ to use this method.

Sets the console mode to mode.

You must require ‘io/console’ to use this method.

No documentation available
No documentation available
No documentation available
No documentation available
Search took: 5ms  ·  Total Results: 3794