hsh.to_a â array Instance Public methods Converts hsh to a nested array of [ key, value ] arrays. h = { "c" => 300, "a" => 100, "d" => 400, "c" => 300 } h.to_a #=> [["c", 300], ["a", 100], ["d", 400]]
hsh.to_h â hsh or new_hash Instance Public methods Returns self. If called on a subclass of Hash, converts the receiver to a Hash object.
hsh.to_hash => hsh Instance Public methods Returns self.
to_s() Instance Public methods Alias for: inspect
hsh.update(other_hash) â hshhsh.update(other_hash){|key, oldval, newval| block} â hsh Instance Public methods Adds the contents of other_hash to hsh. If no block is specified, entries with duplicate keys are overwritten with the values from other_hash, otherwise the value of each duplicate key is determined by calling the block with the key, its value in hsh and its value in other_hash. h1 = { "a" => 100, "b" => 200 } h2 = { "b" => 254,
hsh.value?(value) â true or false Instance Public methods Returns true if the given value is present for some key in hsh. h = { "a" => 100, "b" => 200 } h.has_value?(100) #=> true h.has_value?(999) #=> false
hsh.values â array Instance Public methods Returns a new array populated with the values from hsh. See also Hash#keys. h = { "a" => 100, "b" => 200, "c" => 300 } h.values #=> [100, 200, 300]
hsh.values_at(key, ...) â array Instance Public methods Return an array containing the values associated with the given keys. Also see Hash.select. h = { "cat" => "feline", "dog" => "canine", "cow" => "bovine" } h.values_at("cow", "cat") #=> ["bovine", "feline"]
do_GET(req, res) Instance Public methods
hello(name) Instance Public methods
Page 379 of 11844