Generate a BlockQuote element as a string.
cite
can either be a string, give the URI
for the source of the quoted text, or a hash, giving all attributes of the element, or it can be omitted, in which case the element has no attributes.
The body is provided by the passed-in no-argument block
blockquote("http://www.example.com/quotes/foo.html") { "Foo!" } #=> "<BLOCKQUOTE CITE=\"http://www.example.com/quotes/foo.html\">Foo!</BLOCKQUOTE>
Returns an array of Range
objects that represent the value of field 'Range'
, or nil
if there is no such field; see Range request header:
req = Net::HTTP::Get.new(uri) req['Range'] = 'bytes=0-99,200-299,400-499' req.range # => [0..99, 200..299, 400..499] req.delete('Range') req.range # # => nil
Parses self
destructively in order and returns self
containing the rest arguments left unparsed.
Parses self
destructively in permutation mode and returns self
containing the rest arguments left unparsed.
Substitution of getopts is possible as follows. Also see OptionParser#getopts
.
def getopts(*args) ($OPT = ARGV.getopts(*args)).each do |opt, val| eval "$OPT_#{opt.gsub(/[^A-Za-z0-9_]/, '_')} = val" end rescue OptionParser::ParseError end
Generate a random alphanumeric string.
The argument n specifies the length, in characters, of the alphanumeric string to be generated.
If n is not specified or is nil, 16 is assumed. It may be larger in the future.
The result may contain A-Z, a-z and 0-9.
require 'random/formatter' Random.alphanumeric #=> "2BuBuLf3WfSKyQbR" # or prng = Random.new prng.alphanumeric(10) #=> "i6K93NdqiH"
Is local fetching enabled?
Displays an alert statement
. Asks a question
if given.
Calls say
with msg
or the results of the block if really_verbose is true.
Returns the effective group ID for this process. Not available on all platforms.
Process.egid #=> 500
Sets the curve parameters. generator must be an instance of EC::Point
that is on the curve. order and cofactor are integers.
See the OpenSSL
documentation for EC_GROUP_set_generator()
If object
is an Array object, returns object
.
Otherwise if object
responds to :to_ary
, calls object.to_ary
and returns the result.
Returns nil
if object
does not respond to :to_ary
Raises an exception unless object.to_ary
returns an Array object.