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)
```C
#include <stdio.h>
#include <mruby.h>
#include "mruby/hash.h" // Needs the hash header.
#include "mruby/compile.h"
int main(int argc, char *argv[])
{
mrb_state *mrb = mrb_open();
if (!mrb) { /* handle error */ }
mrb_value new_hash; // Declare variable for new hash object.
mrb_value get_hash_value; // Declare variable for getting a value from a hash.
mrb_sym hash_key_a = mrb_intern_cstr(mrb, "da_key1"); // Declare a symbol.
mrb_sym hash_key_b = mrb_intern_cstr(mrb, "da_key2"); // Declare a symbol.
mrb_int hash_value_a = 80; // Declare a fixnum value.
mrb_int hash_value_b = 90; // Declare a fixnum value.
FILE *fp = fopen("test_ext.rb","r");
new_hash = mrb_hash_new(mrb); // Initialize hash.
mrb_value obj = mrb_load_file(mrb,fp);
mrb_hash_set(mrb, new_hash, mrb_symbol_value(hash_key_a), mrb_fixnum_value(hash_value_a)); // Set values to hash.
mrb_hash_set(mrb, new_hash, mrb_symbol_value(hash_key_b), mrb_fixnum_value(hash_value_b)); // Set values to hash.