summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
Diffstat (limited to 'ext')
-rw-r--r--ext/psych/lib/psych/visitors/visitor.rb9
-rw-r--r--ext/psych/lib/psych/visitors/yaml_tree.rb6
2 files changed, 6 insertions, 9 deletions
diff --git a/ext/psych/lib/psych/visitors/visitor.rb b/ext/psych/lib/psych/visitors/visitor.rb
index 0e33128f01..4d7772f428 100644
--- a/ext/psych/lib/psych/visitors/visitor.rb
+++ b/ext/psych/lib/psych/visitors/visitor.rb
@@ -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
diff --git a/ext/psych/lib/psych/visitors/yaml_tree.rb b/ext/psych/lib/psych/visitors/yaml_tree.rb
index 6df1151ad7..38a42fcaff 100644
--- a/ext/psych/lib/psych/visitors/yaml_tree.rb
+++ b/ext/psych/lib/psych/visitors/yaml_tree.rb
@@ -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