If a doctype includes an ATTLIST declaration, it will cause this method to be called. The content is the declaration itself, unparsed. EG, <!ATTLIST el attr CDATA REQUIRED> will come to this method as “el attr CDATA REQUIRED”. This is the same for all of the .*decl methods.
<!NOTATION …>
Called when <![CDATA[ … ]]> is encountered in a document. @p content “…”
If a doctype includes an ATTLIST declaration, it will cause this method to be called. The content is the declaration itself, unparsed. EG, <!ATTLIST el attr CDATA REQUIRED> will come to this method as “el attr CDATA REQUIRED”. This is the same for all of the .*decl methods.
<!NOTATION …>
Called when <![CDATA[ … ]]> is encountered in a document. @p content “…”
Builder for an RSS
object Creates an object of the type passed in args
Executes the block
to populate elements of the created RSS
object
Returns collection of supported makers
Can I remove this method?
Simple deprecation method that deprecates name
by wrapping it up in a dummy method. It warns on each call to the dummy method telling the user of repl
(unless repl
is :none) and the year/month that it is planned to go away.
Simple deprecation method that deprecates name
by wrapping it up in a dummy method. It warns on each call to the dummy method telling the user of repl
(unless repl
is :none) and the year/month that it is planned to go away.
A Zlib::Inflate#inflate
wrapper
SecureRandom.choose generates a string that randomly draws from a source array of characters.
The argument source specifies the array of characters from which to generate the string. The argument n specifies the length, in characters, of the string to be generated.
The result may contain whatever characters are in the source array.
require 'securerandom' SecureRandom.choose([*'l'..'r'], 16) #=> "lmrqpoonmmlqlron" SecureRandom.choose([*'0'..'9'], 5) #=> "27309"
If a secure random number generator is not available, NotImplementedError
is raised.
Same as Array#each
, but passes the index
of the element instead of the element itself.
An Enumerator
is returned if no block is given.
a = [ "a", "b", "c" ] a.each_index {|x| print x, " -- " }
produces:
0 -- 1 -- 2 --
Same as Array#each
, but traverses self
in reverse order.
a = [ "a", "b", "c" ] a.reverse_each {|x| print x, " " }
produces:
c b a
Returns an array containing the elements in self
corresponding to the given selector
(s).
The selectors may be either integer indices or ranges.
See also Array#select
.
a = %w{ a b c d e f } a.values_at(1, 3, 5) # => ["b", "d", "f"] a.values_at(1, 3, 5, 7) # => ["b", "d", "f", nil] a.values_at(-1, -2, -2, -7) # => ["f", "e", "e", nil] a.values_at(4..6, 3...6) # => ["e", "f", nil, "d", "e", "f"]
Deletes the element at the specified index
, returning that element, or nil
if the index
is out of range.
See also Array#slice!
a = ["ant", "bat", "cat", "dog"] a.delete_at(2) #=> "cat" a #=> ["ant", "bat", "dog"] a.delete_at(99) #=> nil
By using binary search, finds an index of a value from this array which meets the given condition in O(log n) where n is the size of the array.
It supports two modes, depending on the nature of the block. They are exactly the same as in the case of the bsearch
method, with the only difference being that this method returns the index of the element instead of the element itself. For more details consult the documentation for bsearch
.
Returns the list of private methods accessible to obj. If the all parameter is set to false
, only those methods in the receiver will be listed.
Iterates the given block over all prime numbers.
See Prime
#each for more details.