diff options
| author | Seba Gamboa <[email protected]> | 2015-10-20 12:48:31 -0300 |
|---|---|---|
| committer | Seba Gamboa <[email protected]> | 2015-10-20 12:48:31 -0300 |
| commit | 13b552538af9e9794398e4a4177ba1cea04cccca (patch) | |
| tree | a4c682a8750401876eebc7ede793a6ca1ad70fd5 /src/hash.c | |
| parent | f0e997422137e9fc92923a49465f009b2730e78d (diff) | |
| download | mruby-13b552538af9e9794398e4a4177ba1cea04cccca.tar.gz mruby-13b552538af9e9794398e4a4177ba1cea04cccca.zip | |
Remove obvious warnings from docs
Diffstat (limited to 'src/hash.c')
| -rw-r--r-- | src/hash.c | 60 |
1 files changed, 30 insertions, 30 deletions
diff --git a/src/hash.c b/src/hash.c index 44b878890..22937dff2 100644 --- a/src/hash.c +++ b/src/hash.c @@ -294,22 +294,22 @@ mrb_hash_modify(mrb_state *mrb, mrb_value hash) * default value. It is the block's responsibility to store the value * in the hash if required. * - * h = Hash.new("Go Fish") - * h["a"] = 100 - * h["b"] = 200 - * h["a"] #=> 100 - * h["c"] #=> "Go Fish" - * # The following alters the single default object - * h["c"].upcase! #=> "GO FISH" - * h["d"] #=> "GO FISH" - * h.keys #=> ["a", "b"] - * - * # While this creates a new default object each time - * h = Hash.new { |hash, key| hash[key] = "Go Fish: #{key}" } - * h["c"] #=> "Go Fish: c" - * h["c"].upcase! #=> "GO FISH: C" - * h["d"] #=> "Go Fish: d" - * h.keys #=> ["c", "d"] + * h = Hash.new("Go Fish") + * h["a"] = 100 + * h["b"] = 200 + * h["a"] #=> 100 + * h["c"] #=> "Go Fish" + * # The following alters the single default object + * h["c"].upcase! #=> "GO FISH" + * h["d"] #=> "GO FISH" + * h.keys #=> ["a", "b"] + * + * # While this creates a new default object each time + * h = Hash.new { |hash, key| hash[key] = "Go Fish: #{key}" } + * h["c"] #=> "Go Fish: c" + * h["c"].upcase! #=> "GO FISH: C" + * h["d"] #=> "Go Fish: d" + * h.keys #=> ["c", "d"] * */ @@ -517,10 +517,10 @@ mrb_hash_delete_key(mrb_state *mrb, mrb_value hash, mrb_value key) * key is not found, pass in the key and return the result of * <i>block</i>. * - * h = { "a" => 100, "b" => 200 } - * h.delete("a") #=> 100 - * h.delete("z") #=> nil - * h.delete("z") { |el| "#{el} not found" } #=> "z not found" + * h = { "a" => 100, "b" => 200 } + * h.delete("a") #=> 100 + * h.delete("z") #=> nil + * h.delete("z") { |el| "#{el} not found" } #=> "z not found" * */ static mrb_value @@ -541,9 +541,9 @@ mrb_hash_delete(mrb_state *mrb, mrb_value self) * two-item array <code>[</code> <i>key, value</i> <code>]</code>, or * the hash's default value if the hash is empty. * - * h = { 1 => "a", 2 => "b", 3 => "c" } - * h.shift #=> [1, "a"] - * h #=> {2=>"b", 3=>"c"} + * h = { 1 => "a", 2 => "b", 3 => "c" } + * h.shift #=> [1, "a"] + * h #=> {2=>"b", 3=>"c"} */ static mrb_value @@ -580,10 +580,10 @@ mrb_hash_shift(mrb_state *mrb, mrb_value hash) * call-seq: * hsh.clear -> hsh * - * Removes all key-value pairs from <i>hsh</i>. + * Removes all key-value pairs from `hsh`. * - * h = { "a" => 100, "b" => 200 } #=> {"a"=>100, "b"=>200} - * h.clear #=> {} + * h = { "a" => 100, "b" => 200 } #=> {"a"=>100, "b"=>200} + * h.clear #=> {} * */ @@ -609,10 +609,10 @@ mrb_hash_clear(mrb_state *mrb, mrb_value hash) * use as a key (a <code>String</code> passed as a key will be * duplicated and frozen). * - * h = { "a" => 100, "b" => 200 } - * h["a"] = 9 - * h["c"] = 4 - * h #=> {"a"=>9, "b"=>200, "c"=>4} + * h = { "a" => 100, "b" => 200 } + * h["a"] = 9 + * h["c"] = 4 + * h #=> {"a"=>9, "b"=>200, "c"=>4} * */ static mrb_value |
