Like Enumerable#filter_map
, but chains operation to be lazy-evaluated.
(1..).lazy.filter_map { |i| i * 2 if i.even? }.first(5) #=> [4, 8, 12, 16, 20]
Like Enumerable#chunk_while
, but chains operation to be lazy-evaluated.
Like Enumerable#map
, but chains operation to be lazy-evaluated.
(1..Float::INFINITY).lazy.map {|i| i**2 } #=> #<Enumerator::Lazy: #<Enumerator::Lazy: 1..Infinity>:map> (1..Float::INFINITY).lazy.map {|i| i**2 }.first(3) #=> [1, 4, 9]
Generates a random prime number of bit length bits. If safe is set to true
, generates a safe prime. If add is specified, generates a prime that fulfills condition p % add = rem
.
Sets the cipher’s additional authenticated data. This field must be set when using AEAD cipher modes such as GCM or CCM. If no associated data shall be used, this method must still be called with a value of “”. The contents of this field should be non-sensitive data which will be added to the ciphertext to generate the authentication tag which validates the contents of the ciphertext.
The AAD must be set prior to encryption or decryption. In encryption mode, it must be set after calling Cipher#encrypt
and setting Cipher#key=
and Cipher#iv=
. When decrypting, the authenticated data must be set after key, iv and especially after the authentication tag has been set. I.e. set it only after calling Cipher#decrypt
, Cipher#key=
, Cipher#iv=
and Cipher#auth_tag=
first.
Emit a sequence with map
and tag
Called when a map starts.
anchor
is the anchor associated with the map or nil
. tag
is the tag associated with the map or nil
. implicit
is a boolean indicating whether or not the map was implicitly started. style
is an integer indicating the mapping style.
See the constants in Psych::Nodes::Mapping
for the possible values of style
.
Here is a YAML
document that exercises most of the possible ways this method can be called:
--- k: !!map { hello: world } v: &pewpew hello: world
The above YAML
document consists of three maps, an outer map that contains two inner maps. Below is a matrix of the parameters sent in order to represent these three maps:
# anchor tag implicit style [nil, nil, true, 1 ] [nil, "tag:yaml.org,2002:map", false, 2 ] ["pewpew", nil, true, 1 ]
Called when a map ends
Called before each event with line/column information.
Start emitting a YAML
map with anchor
, tag
, an implicit
start and end, and style
.
Builds a methods for level meth
.
Enumerate values.
Enumerate subkeys.
subkey is String
which contains name of subkey. wtime is last write time as FILETIME (64-bit integer). (see Registry.wtime2time
)
Returns major version.
tobj = WIN32OLE_TYPE.new('Microsoft Word 10.0 Object Library', 'Documents') puts tobj.major_version # => 8
Returns the type library major version.
tlib = WIN32OLE_TYPELIB.new('Microsoft Excel 9.0 Object Library') puts tlib.major_version # -> 1
Guesses the type of the data which have been inputed into the stream. The returned value is either BINARY
, ASCII
, or UNKNOWN
.