@@ -37,7 +37,7 @@ def yaml_initialize( tag, val )
3737 end
3838 end
3939 def to_yaml ( opts = { } )
40- return super unless YAML :: ENGINE . syck?
40+ return super unless YAML == Syck
4141 Syck ::quick_emit ( self , opts ) do |out |
4242 out . map ( taguri , to_yaml_style ) do |map |
4343 each do |k , v |
@@ -86,7 +86,7 @@ def self.yaml_new( klass, tag, val )
8686 end
8787 end
8888 def to_yaml ( opts = { } )
89- return super unless YAML :: ENGINE . syck?
89+ return super unless YAML == Syck
9090 Syck ::quick_emit ( self , opts ) do |out |
9191 #
9292 # Basic struct is passed as a YAML map
@@ -108,7 +108,7 @@ class Array
108108 yaml_as "tag:yaml.org,2002:seq"
109109 def yaml_initialize ( tag , val ) ; concat ( val . to_a ) ; end
110110 def to_yaml ( opts = { } )
111- return super unless YAML :: ENGINE . syck?
111+ return super unless YAML == Syck
112112 Syck ::quick_emit ( self , opts ) do |out |
113113 out . seq ( taguri , to_yaml_style ) do |seq |
114114 each do |x |
@@ -130,7 +130,7 @@ def Exception.yaml_new( klass, tag, val )
130130 o
131131 end
132132 def to_yaml ( opts = { } )
133- return super unless YAML :: ENGINE . syck?
133+ return super unless YAML == Syck
134134 Syck ::quick_emit ( self , opts ) do |out |
135135 out . map ( taguri , to_yaml_style ) do |map |
136136 map . add ( 'message' , message )
@@ -168,7 +168,7 @@ def String.yaml_new( klass, tag, val )
168168 end
169169 end
170170 def to_yaml ( opts = { } )
171- return super unless YAML :: ENGINE . syck?
171+ return super unless YAML == Syck
172172 Syck ::quick_emit ( is_complex_yaml? ? self : nil , opts ) do |out |
173173 if is_binary_data?
174174 out . scalar ( "tag:yaml.org,2002:binary" , [ self ] . pack ( "m" ) , :literal )
@@ -198,7 +198,7 @@ def Symbol.yaml_new( klass, tag, val )
198198 end
199199 end
200200 def to_yaml ( opts = { } )
201- return super unless YAML :: ENGINE . syck?
201+ return super unless YAML == Syck
202202 Syck ::quick_emit ( nil , opts ) do |out |
203203 out . scalar ( "tag:yaml.org,2002:str" , self . inspect , :plain )
204204 end
@@ -236,7 +236,7 @@ def Range.yaml_new( klass, tag, val )
236236 end
237237 end
238238 def to_yaml ( opts = { } )
239- return super unless YAML :: ENGINE . syck?
239+ return super unless YAML == Syck
240240 Syck ::quick_emit ( self , opts ) do |out |
241241 # if self.begin.is_complex_yaml? or self.begin.respond_to? :to_str or
242242 # self.end.is_complex_yaml? or self.end.respond_to? :to_str or
@@ -287,7 +287,7 @@ def Regexp.yaml_new( klass, tag, val )
287287 end
288288 end
289289 def to_yaml ( opts = { } )
290- return super unless YAML :: ENGINE . syck?
290+ return super unless YAML == Syck
291291 Syck ::quick_emit ( nil , opts ) do |out |
292292 if to_yaml_properties . empty?
293293 out . scalar ( taguri , self . inspect , :plain )
@@ -322,7 +322,7 @@ def Time.yaml_new( klass, tag, val )
322322 end
323323 end
324324 def to_yaml ( opts = { } )
325- return super unless YAML :: ENGINE . syck?
325+ return super unless YAML == Syck
326326 Syck ::quick_emit ( self , opts ) do |out |
327327 tz = "Z"
328328 # from the tidy Tobias Peters <t-peters@gmx.de> Thanks!
@@ -360,7 +360,7 @@ def to_yaml( opts = {} )
360360class Date
361361 yaml_as "tag:yaml.org,2002:timestamp#ymd"
362362 def to_yaml ( opts = { } )
363- return super unless YAML :: ENGINE . syck?
363+ return super unless YAML == Syck
364364 Syck ::quick_emit ( self , opts ) do |out |
365365 out . scalar ( "tag:yaml.org,2002:timestamp" , self . to_s , :plain )
366366 end
@@ -370,7 +370,7 @@ def to_yaml( opts = {} )
370370class Integer
371371 yaml_as "tag:yaml.org,2002:int"
372372 def to_yaml ( opts = { } )
373- return super unless YAML :: ENGINE . syck?
373+ return super unless YAML == Syck
374374 Syck ::quick_emit ( nil , opts ) do |out |
375375 out . scalar ( "tag:yaml.org,2002:int" , self . to_s , :plain )
376376 end
@@ -380,7 +380,7 @@ def to_yaml( opts = {} )
380380class Float
381381 yaml_as "tag:yaml.org,2002:float"
382382 def to_yaml ( opts = { } )
383- return super unless YAML :: ENGINE . syck?
383+ return super unless YAML == Syck
384384 Syck ::quick_emit ( nil , opts ) do |out |
385385 str = self . to_s
386386 if str == "Infinity"
@@ -405,7 +405,7 @@ def Rational.yaml_new( klass, tag, val )
405405 end
406406 end
407407 def to_yaml ( opts = { } )
408- return super unless YAML :: ENGINE . syck?
408+ return super unless YAML == Syck
409409 Syck ::quick_emit ( self , opts ) do |out |
410410 out . map ( taguri , nil ) do |map |
411411 map . add ( 'denominator' , denominator )
@@ -425,7 +425,7 @@ def Complex.yaml_new( klass, tag, val )
425425 end
426426 end
427427 def to_yaml ( opts = { } )
428- return super unless YAML :: ENGINE . syck?
428+ return super unless YAML == Syck
429429 Syck ::quick_emit ( self , opts ) do |out |
430430 out . map ( taguri , nil ) do |map |
431431 map . add ( 'image' , imaginary )
@@ -438,7 +438,7 @@ def to_yaml( opts = {} )
438438class TrueClass
439439 yaml_as "tag:yaml.org,2002:bool#yes"
440440 def to_yaml ( opts = { } )
441- return super unless YAML :: ENGINE . syck?
441+ return super unless YAML == Syck
442442 Syck ::quick_emit ( nil , opts ) do |out |
443443 out . scalar ( taguri , "true" , :plain )
444444 end
@@ -448,7 +448,7 @@ def to_yaml( opts = {} )
448448class FalseClass
449449 yaml_as "tag:yaml.org,2002:bool#no"
450450 def to_yaml ( opts = { } )
451- return super unless YAML :: ENGINE . syck?
451+ return super unless YAML == Syck
452452 Syck ::quick_emit ( nil , opts ) do |out |
453453 out . scalar ( taguri , "false" , :plain )
454454 end
@@ -458,10 +458,9 @@ def to_yaml( opts = {} )
458458class NilClass
459459 yaml_as "tag:yaml.org,2002:null"
460460 def to_yaml ( opts = { } )
461- return super unless YAML :: ENGINE . syck?
461+ return super unless YAML == Syck
462462 Syck ::quick_emit ( nil , opts ) do |out |
463463 out . scalar ( taguri , "" , :plain )
464464 end
465465 end
466466end
467-
0 commit comments