Class: Object::Syck::Out
Instance Attribute Summary collapse
Instance Method Summary collapse
- #initialize(emitter) ⇒ Object constructor
- #map(*args) ⇒ Object
- #scalar(*args) ⇒ Object
- #seq(*args) ⇒ Object
Constructor Details
#initialize(emitter) ⇒ Object
2244 2245 2246 2247 2248 2249 |
# File 'ext/syck/rubyext.c', line 2244
VALUE
syck_out_initialize(VALUE self, VALUE emitter)
{
rb_ivar_set( self, s_emitter, emitter );
return self;
}
|
Instance Attribute Details
#emitter ⇒ Object
Instance Method Details
#map(*args) ⇒ Object
2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 |
# File 'ext/syck/rubyext.c', line 2254
VALUE
syck_out_map(int argc, VALUE *argv, VALUE self)
{
VALUE type_id, style, map;
if (rb_scan_args(argc, argv, "11", &type_id, &style) == 1) {
style = Qnil;
}
map = rb_funcall( cMap, s_new, 3, type_id, rb_hash_new(), style );
syck_out_mark( rb_ivar_get( self, s_emitter ), map );
rb_yield( map );
return map;
}
|
#scalar(*args) ⇒ Object
2288 2289 2290 2291 2292 2293 2294 2295 2296 |
# File 'ext/syck/rubyext.c', line 2288
VALUE
syck_out_scalar(int argc, VALUE *argv, VALUE self)
{
VALUE type_id, str, style, scalar;
rb_scan_args(argc, argv, "21", &type_id, &str, &style);
scalar = rb_funcall( cScalar, s_new, 3, type_id, str, style );
syck_out_mark( rb_ivar_get( self, s_emitter ), scalar );
return scalar;
}
|
#seq(*args) ⇒ Object
2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 |
# File 'ext/syck/rubyext.c', line 2270
VALUE
syck_out_seq(int argc, VALUE *argv, VALUE self)
{
VALUE type_id, style, seq;
if (rb_scan_args(argc, argv, "11", &type_id, &style) == 1) {
style = Qnil;
}
seq = rb_funcall( cSeq, s_new, 3, type_id, rb_ary_new(), style );
syck_out_mark( rb_ivar_get( self, s_emitter ), seq );
rb_yield( seq );
return seq;
}
|