Class: JvYAML::JvYAMLi::Node
- Inherits:
-
Object
- Object
- JvYAML::JvYAMLi::Node
- Defined in:
- lib/jvyaml.rb
Instance Attribute Summary collapse
-
#style ⇒ Object
Returns the value of attribute style.
-
#type_id ⇒ Object
Returns the value of attribute type_id.
-
#value ⇒ Object
Returns the value of attribute value.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#style ⇒ Object
Returns the value of attribute style.
140 141 142 |
# File 'lib/jvyaml.rb', line 140 def style @style end |
#type_id ⇒ Object
Returns the value of attribute type_id.
141 142 143 |
# File 'lib/jvyaml.rb', line 141 def type_id @type_id end |
#value ⇒ Object
Returns the value of attribute value.
139 140 141 |
# File 'lib/jvyaml.rb', line 139 def value @value end |
Class Method Details
.from_internal(internal) ⇒ Object
155 156 157 158 159 160 161 162 163 164 |
# File 'lib/jvyaml.rb', line 155 def self.from_internal(internal) case internal when org.jvyamlb.nodes.ScalarNode Scalar.new(internal.tag, internal.value, internal.style.chr) when org.jvyamlb.nodes.MappingNode Map.new(internal.tag, internal.value.inject({}) {|h, obj| h[from_internal(obj[0])] = from_internal(obj[1]); h}, internal.flow_style) when org.jvyamlb.nodes.SequenceNode Seq.new(internal.tag, internal.value.map {|obj| from_internal(obj)}, internal.flow_style) end end |
Instance Method Details
#transform ⇒ Object
143 144 145 |
# File 'lib/jvyaml.rb', line 143 def transform org.jruby.ext.jvyaml.JRubyConstructor.new(self, nil).construct_document(to_internal) end |