summaryrefslogtreecommitdiff
path: root/ext/psych/lib/psych/coder.rb
diff options
context:
space:
mode:
authortenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-04-16 20:27:51 +0000
committertenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-04-16 20:27:51 +0000
commit2db7b7f3fe7de2b518d46ea11c26875f86d26136 (patch)
tree063260cf9c6da1074cbf3d7413b173206b5cb8f5 /ext/psych/lib/psych/coder.rb
parent039219b2c978641d96fe28ba451148b0425ffd4e (diff)
* ext/psych/lib/psych/coder.rb (scalar): supporting deprecated methods
* ext/psych/lib/psych/deprecated.rb: supporting deprecated to_yaml_properties method git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27364 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
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