Generate a sequence of radio button Input elements, as a String
.
This works the same as checkbox_group()
. However, it is not valid to have more than one radiobutton in a group checked.
radio_group("name", "foo", "bar", "baz") # <INPUT TYPE="radio" NAME="name" VALUE="foo">foo # <INPUT TYPE="radio" NAME="name" VALUE="bar">bar # <INPUT TYPE="radio" NAME="name" VALUE="baz">baz radio_group("name", ["foo"], ["bar", true], "baz") # <INPUT TYPE="radio" NAME="name" VALUE="foo">foo # <INPUT TYPE="radio" CHECKED NAME="name" VALUE="bar">bar # <INPUT TYPE="radio" NAME="name" VALUE="baz">baz radio_group("name", ["1", "Foo"], ["2", "Bar", true], "Baz") # <INPUT TYPE="radio" NAME="name" VALUE="1">Foo # <INPUT TYPE="radio" CHECKED NAME="name" VALUE="2">Bar # <INPUT TYPE="radio" NAME="name" VALUE="Baz">Baz radio_group("NAME" => "name", "VALUES" => ["foo", "bar", "baz"]) radio_group("NAME" => "name", "VALUES" => [["foo"], ["bar", true], "baz"]) radio_group("NAME" => "name", "VALUES" => [["1", "Foo"], ["2", "Bar", true], "Baz"])
returns a Time
that represents the Last-Modified field.
Returns a list of encodings in Content-Encoding field as an array of strings.
The encodings are downcased for canonicalization.
This code is based directly on the Text
gem implementation Returns a value representing the “cost” of transforming str1 into str2
The number of bytes that are immediately available for reading.
Filters the supplied nodeset on the predicate(s)
| AdditiveExpr
(‘+’ | ‘-’) MultiplicativeExpr
| MultiplicativeExpr
The version requirement for this dependency request
Returns true, if circular data structures should be checked, otherwise returns false.
Checks if ios
starts with a BOM, and then consumes it and sets the external encoding. Returns the result encoding if found, or nil. If ios
is not binmode or its encoding has been set already, an exception will be raised.
File.write("bom.txt", "\u{FEFF}abc") ios = File.open("bom.txt", "rb") ios.set_encoding_by_bom #=> #<Encoding:UTF-8> File.write("nobom.txt", "abc") ios = File.open("nobom.txt", "rb") ios.set_encoding_by_bom #=> nil
Re-composes a prime factorization and returns the product.
pd
Array
of pairs of integers. The each internal pair consists of a prime number – a prime factor – and a natural number – an exponent.
For [[p_1, e_1], [p_2, e_2], ...., [p_n, e_n]]
, it returns:
p_1**e_1 * p_2**e_2 * .... * p_n**e_n. Prime.int_from_prime_division([[2,2], [3,1]]) #=> 12
The version of Ruby required by this gem. The ruby version can be specified to the patch-level:
$ ruby -v -e 'p Gem.ruby_version' ruby 2.0.0p247 (2013-06-27 revision 41674) [x86_64-darwin12.4.0] #<Gem::Version "2.0.0.247">
Prereleases can also be specified.
Usage:
# This gem will work with 1.8.6 or greater... spec.required_ruby_version = '>= 1.8.6' # Only with final releases of major version 2 where minor version is at least 3 spec.required_ruby_version = '~> 2.3' # Only prereleases or final releases after 2.6.0.preview2 spec.required_ruby_version = '> 2.6.0.preview2'
The RubyGems version required by this gem