Ruby 2.0.0p353(2013-11-22revision43784)

- 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: */
target
VALUE target
Definition: tcltklib.c:5532
rb_define_private_method
void rb_define_private_method(VALUE klass, const char *name, VALUE(*func)(ANYARGS), int argc)
Definition: class.c:1356
private_iv_get
static VALUE private_iv_get(VALUE self, VALUE target, VALUE prop)
Definition: psych_yaml_tree.c:10
cPsychVisitorsYamlTree
VALUE cPsychVisitorsYamlTree
Definition: psych_yaml_tree.c:3
rb_define_class_under
VALUE rb_define_class_under(VALUE outer, const char *name, VALUE super)
Defines a class under the namespace of outer.
Definition: class.c:545
psych.h
StringValuePtr
#define StringValuePtr(v)
Init_psych_yaml_tree
void Init_psych_yaml_tree(void)
Definition: psych_yaml_tree.c:15
rb_attr_get
VALUE rb_attr_get(VALUE, ID)
Definition: variable.c:1122
rb_define_module_under
VALUE rb_define_module_under(VALUE outer, const char *name)
Definition: class.c:637
rb_cObject
RUBY_EXTERN VALUE rb_cObject
Definition: ripper.y:1426
VALUE
unsigned long VALUE
Definition: ripper.y:104
rb_define_module
VALUE rb_define_module(const char *name)
Definition: class.c:617
rb_intern
#define rb_intern(str)