Class: Object::Syck::Out

Inherits:
Object
  • Object
show all
Defined in:
rubyext.c

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeObject

YAML::Syck::Out::initialize



2059
2060
2061
2062
2063
2064
# File 'rubyext.c', line 2059

VALUE
syck_out_initialize(VALUE self, VALUE emitter)
{
    rb_ivar_set( self, s_emitter, emitter );
    return self;
}

Instance Attribute Details

#emitterObject

Instance Method Details

#mapObject

YAML::Syck::Out::map



2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
# File 'rubyext.c', line 2069

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;
}

#scalarObject

YAML::Syck::Out::scalar syck_out_scalar( self, type_id, str, style )

VALUE self, type_id, str, style;


2103
2104
2105
2106
2107
2108
2109
2110
2111
# File 'rubyext.c', line 2103

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;
}

#seqObject

YAML::Syck::Out::seq



2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
# File 'rubyext.c', line 2085

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;
}