diff options
| author | Ralph Desir <[email protected]> | 2015-07-17 14:25:15 -0400 |
|---|---|---|
| committer | Ralph Desir <[email protected]> | 2015-07-17 14:25:15 -0400 |
| commit | f282d947933b81a4c93f2cccf0313c3431458b51 (patch) | |
| tree | 432a25b8ffb5ecb70ba4dd36c370fa007612442f /doc/api | |
| parent | 78a40fce8881247419955291f34ca36eb0549126 (diff) | |
| download | mruby-f282d947933b81a4c93f2cccf0313c3431458b51.tar.gz mruby-f282d947933b81a4c93f2cccf0313c3431458b51.zip | |
Update hash.h.md
Diffstat (limited to 'doc/api')
| -rw-r--r-- | doc/api/mruby/hash.h.md | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/doc/api/mruby/hash.h.md b/doc/api/mruby/hash.h.md index bdc2a7f2b..b7962696c 100644 --- a/doc/api/mruby/hash.h.md +++ b/doc/api/mruby/hash.h.md @@ -55,8 +55,11 @@ Sets a keys and values to hashes. #### Example
In this example we read from a Ruby file inside C. The Ruby code will print what you pass as an argument
-and what class the passed in value is. This example sets a key and value pair to a hash. In pure Ruby doing this is equivalent to a = {:da_key => 80}.
+and what class the passed in value is. This example sets a key and value pair to a hash. In pure Ruby doing this is equivalent to:
+```Ruby
+a = {:da_key => 80}
+```
```C
#include <stdio.h>
@@ -114,8 +117,12 @@ Gets a value from a key. #### Example
In this example we read from a Ruby file inside C. The Ruby code will print what you pass as an argument
-and what class the passed in value is. This example gets a value from a key. In pure Ruby doing this is equivalent to a = {:da_key => 80}
-a[:da_key].
+and what class the passed in value is. This example gets a value from a key. In pure Ruby doing this is equivalent to:
+
+```Ruby
+a = {:da_key => 80}
+a[:da_key]
+```
```C
#include <stdio.h>
@@ -177,9 +184,12 @@ Deletes hash key and value pair. #### Example
In this example we read from a Ruby file inside C. The Ruby code will print what you pass as an argument
-and what class the passed in value is. This example deletes hash key and value pair. In pure Ruby doing this is equivalent to a = {:da_key1 => 80,:da_key2 => 90}
-a.delete(:da_key2)
+and what class the passed in value is. This example deletes hash key and value pair. In pure Ruby doing this is equivalent to:
+```Ruby
+a = {:da_key1 => 80,:da_key2 => 90}
+a.delete(:da_key2)
+```
```C
#include <stdio.h>
@@ -308,9 +318,12 @@ Clears the hash. #### Example
In this example we read from a Ruby file inside C. The Ruby code will print what you pass as an argument
-and what class the passed in value is. This example clears the hash. In pure Ruby doing this is equivalent to
+and what class the passed in value is. This example clears the hash. In pure Ruby doing this is equivalent to:
+
+```Ruby
a = {:da_key1 => 80,:da_key2 => 90}
a.clear
+```
```C
#include <stdio.h>
|
