Class: Psych::Visitors::Visitor
- Defined in:
- lib/psych/visitors/visitor.rb,
ext/psych/to_ruby.c,
ext/psych/yaml_tree.c
Instance Attribute Summary collapse
-
#finished ⇒ Object
(also: #finished?)
readonly
Returns the value of attribute finished.
-
#started ⇒ Object
(also: #started?)
readonly
Returns the value of attribute started.
Instance Method Summary collapse
- #accept(target) ⇒ Object
-
#initialize ⇒ Visitor
constructor
A new instance of Visitor.
Constructor Details
#initialize ⇒ Visitor
Returns a new instance of Visitor.
8 9 10 11 |
# File 'lib/psych/visitors/visitor.rb', line 8 def initialize @started = false @finished = false end |
Instance Attribute Details
#finished ⇒ Object (readonly) Also known as: finished?
Returns the value of attribute finished.
4 5 6 |
# File 'lib/psych/visitors/visitor.rb', line 4 def finished @finished end |
#started ⇒ Object (readonly) Also known as: started?
Returns the value of attribute started.
4 5 6 |
# File 'lib/psych/visitors/visitor.rb', line 4 def started @started end |
Instance Method Details
#accept(target) ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/psych/visitors/visitor.rb', line 13 def accept target case target when Psych::Nodes::Scalar then visit_Psych_Nodes_Scalar target when Psych::Nodes::Mapping then visit_Psych_Nodes_Mapping target when Psych::Nodes::Sequence then visit_Psych_Nodes_Sequence target when Psych::Nodes::Alias then visit_Psych_Nodes_Alias target when Psych::Nodes::Document then visit_Psych_Nodes_Document target when Psych::Nodes::Stream then visit_Psych_Nodes_Stream target else raise "Can't handle #{target}" end end |