1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* ext/psych/lib/psych/visitors/visitor.rb (initialize): push accessor

methods to subclass that actually uses them.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29672 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
tenderlove 2010-11-02 21:25:27 +00:00
parent d5b2de3af1
commit 3d2e701396
3 changed files with 11 additions and 9 deletions

View file

@ -1,3 +1,8 @@
Tue Nov 2 22:50:25 2010 Aaron Patterson <aaron@tenderlovemaking.com>
* ext/psych/lib/psych/visitors/visitor.rb (initialize): push accessor
methods to subclass that actually uses them.
Tue Nov 2 22:47:08 2010 Aaron Patterson <aaron@tenderlovemaking.com>
* ext/psych/lib/psych/visitors/visitor.rb (accept): switch to

View file

@ -1,15 +1,6 @@
module Psych
module Visitors
class Visitor
attr_reader :started, :finished
alias :finished? :finished
alias :started? :started
def initialize
@started = false
@finished = false
end
def accept target
visit target
end

View file

@ -8,8 +8,14 @@ module Psych
# builder.tree # => #<Psych::Nodes::Stream .. }
#
class YAMLTree < Psych::Visitors::Visitor
attr_reader :started, :finished
alias :finished? :finished
alias :started? :started
def initialize options = {}, emitter = Psych::TreeBuilder.new
super()
@started = false
@finished = false
@emitter = emitter
@st = {}
@ss = ScalarScanner.new