Ruby 2.0.0p247(2013-06-27revision41674)

- Main Page
- Modules
- Data Structures
- Files

- File List
- Globals

psych_yaml_tree.c
Go to the documentation of this file.
1 #include <psych.h>
2
3 VALUE cPsychVisitorsYamlTree;
4
5 /*
6 * call-seq: private_iv_get(target, prop)
7 *
8 * Get the private instance variable +prop+ from +target+
9 */
10 static VALUE private_iv_get(VALUE self, VALUE target, VALUE prop)
11 {
12 return rb_attr_get(target, rb_intern(StringValuePtr(prop)));
13 }
14
15 void Init_psych_yaml_tree(void)
16 {
17 VALUE psych = rb_define_module("Psych");
18 VALUE visitors = rb_define_module_under(psych, "Visitors");
19 VALUE visitor = rb_define_class_under(visitors, "Visitor", rb_cObject);
20 cPsychVisitorsYamlTree = rb_define_class_under(visitors, "YAMLTree", visitor);
21
22 rb_define_private_method(cPsychVisitorsYamlTree, "private_iv_get", private_iv_get, 2);
23 }
24 /* vim: set noet sws=4 sw=4: */
25