Opens a new transaction for the data store. Code executed inside a block passed to this method may read and write data to and from the data store file.
At the end of the block, changes are committed to the data store automatically. You may exit the transaction early with a call to either PStore#commit
or PStore#abort
. See those methods for details about how changes are handled. Raising an uncaught Exception
in the block is equivalent to calling PStore#abort
.
If read_only is set to true
, you will only be allowed to read from the data store during the transaction and any attempts to change the data will raise a PStore::Error
.
Note that PStore
does not support nested transactions.
Returns x/y
or arg
as a Rational
.
Rational(2, 3) #=> (2/3) Rational(5) #=> (5/1) Rational(0.5) #=> (1/2) Rational(0.3) #=> (5404319552844595/18014398509481984) Rational("2/3") #=> (2/3) Rational("0.3") #=> (3/10) Rational("10 cents") #=> ArgumentError Rational(nil) #=> TypeError Rational(1, nil) #=> TypeError Rational("10 cents", exception: false) #=> nil
Syntax of the string form:
string form = extra spaces , rational , extra spaces ; rational = [ sign ] , unsigned rational ; unsigned rational = numerator | numerator , "/" , denominator ; numerator = integer part | fractional part | integer part , fractional part ; denominator = digits ; integer part = digits ; fractional part = "." , digits , [ ( "e" | "E" ) , [ sign ] , digits ] ; sign = "-" | "+" ; digits = digit , { digit | "_" , digit } ; digit = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" ; extra spaces = ? \s* ? ;
See also String#to_r
.
Sends a OPTIONS request to the path
and gets a response, as an HTTPResponse
object.
Create on demand parser.
Returns the parser to be used.
Unless a URI::Parser
is defined, DEFAULT_PARSER is used.
Merge a set of command options with the set of default options (without modifying the default option hash).
Add the –prerelease option to the option parser.
Run UDP/IP server loop on the given sockets.
The return value of Socket.udp_server_sockets
is appropriate for the argument.
It calls the block for each message received.
Parses a given string as a blob that contains configuration for OpenSSL
.
Get the names of all sections in the current configuration.
Parse the YAML
document contained in yaml
. Events will be called on the handler set on the parser instance.
See Psych::Parser
and Psych::Parser#handler
Starts the parser. init
is a data accumulator and is passed to the next event handler (as of Enumerable#inject
).
Parse a raw cookie string into a hash of cookie-name=>Cookie pairs.
cookies = CGI::Cookie.parse("raw_cookie_string") # { "name1" => cookie1, "name2" => cookie2, ... }
Create a DRbUnknownError
exception containing this object.
Turns on net/http 1.2 (Ruby 1.8) features. Defaults to ON in Ruby 1.8 or later.
Version of the gem