summaryrefslogtreecommitdiff
path: root/ext/psych/lib/psych/coder.rb
diff options
context:
space:
mode:
Diffstat (limited to 'ext/psych/lib/psych/coder.rb')
-rw-r--r--ext/psych/lib/psych/coder.rb11
1 files changed, 10 insertions, 1 deletions
diff --git a/ext/psych/lib/psych/coder.rb b/ext/psych/lib/psych/coder.rb
index eff0cc3dcb..c06c9c1e61 100644
--- a/ext/psych/lib/psych/coder.rb
+++ b/ext/psych/lib/psych/coder.rb
@@ -7,7 +7,7 @@ module Psych
# called, respectively.
class Coder
attr_accessor :tag, :style, :implicit
- attr_reader :type, :scalar, :seq
+ attr_reader :type, :seq
def initialize tag
@map = {}
@@ -19,6 +19,15 @@ module Psych
@scalar = nil
end
+ def scalar *args
+ if args.length > 0
+ warn "#{caller[0]}: Coder#scalar(a,b,c) is deprecated" if $VERBOSE
+ @tag, @scalar, _ = args
+ @type = :scalar
+ end
+ @scalar
+ end
+
# Emit a map. The coder will be yielded to the block.
def map tag = @tag, style = @style
@tag = tag