Ruby
2.7.0p0(2019-12-25revision647ee6f091eafcce70ffb75ddf7e121e192ab217)
ext
psych
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
(
StringValueCStr
(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: */
rb_define_module_under
VALUE rb_define_module_under(VALUE outer, const char *name)
Definition:
class.c:797
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:1084
VALUE
unsigned long VALUE
Definition:
ruby.h:102
rb_intern
#define rb_intern(str)
rb_define_module
VALUE rb_define_module(const char *name)
Definition:
class.c:772
psych.h
StringValueCStr
#define StringValueCStr(v)
Definition:
ruby.h:604
rb_cObject
RUBY_EXTERN VALUE rb_cObject
Definition:
ruby.h:2010
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:698
rb_define_private_method
void rb_define_private_method(VALUE klass, const char *name, VALUE(*func)(ANYARGS), int argc)
Definition:
class.c:1569
Generated by
1.8.17