returns “type/subtype” which is MIME Content-Type. It is downcased for canonicalization. Content-Type parameters are stripped.
Returns a list of encodings in Content-Encoding field as an array of strings.
The encodings are downcased for canonicalization.
Creates an unsigned certificate for subject
and key
. The lifetime of the key is from the current time to age
which defaults to one year.
The extensions
restrict the key to the indicated uses.
Displays an error statement
to the error output location. Asks a question
if given.
Attempts to activate the current {#possibility} @return [void]
Add the current {#possibility} to the dependency graph of the current {#state} @return [void]
Returns the string that is used to insert a space between the tokens in a JSON
string.
Sets space to the string that is used to insert a space between the tokens in a JSON
string.
Writes data
onto the IO
, raising a FileOverflow
exception if the number of bytes will be more than limit
Writes data
onto the IO
Topologically sorts the given vertices. @param [Enumerable<Vertex>] vertices the vertices to be sorted, which must
all belong to the same graph.
@return [Array<Vertex>] The sorted vertices.
Returns the path between two vertices @raise [ArgumentError] if there is no path between the vertices @param [Vertex] from @param [Vertex] to @return [Array<Vertex>] the shortest path from ‘from` to `to`
Same as Enumerator#with_index(0)
, i.e. there is no starting offset.
If no block is given, a new Enumerator
is returned that includes the index.
Iterates the given block for each element with an arbitrary object, obj
, and returns obj
If no block is given, returns a new Enumerator
.
to_three = Enumerator.new do |y| 3.times do |x| y << x end end to_three_with_string = to_three.with_object("foo") to_three_with_string.each do |x,string| puts "#{string}: #{x}" end # => foo: 0 # => foo: 1 # => foo: 2
Returns the value of the given instance variable, or nil if the instance variable is not set. The @
part of the variable name should be included for regular instance variables. Throws a NameError
exception if the supplied symbol is not valid as an instance variable name. String
arguments are converted to symbols.
class Fred def initialize(p1, p2) @a, @b = p1, p2 end end fred = Fred.new('cat', 99) fred.instance_variable_get(:@a) #=> "cat" fred.instance_variable_get("@b") #=> 99