Class: ONIX::Serializer::Dump::Primitive
- Inherits:
-
Object
- Object
- ONIX::Serializer::Dump::Primitive
- Defined in:
- lib/onix/serializer.rb
Class Method Summary collapse
Class Method Details
.serialize(io, val, tag, level = 0) ⇒ Object
175 176 177 178 179 180 181 182 |
# File 'lib/onix/serializer.rb', line 175 def self.serialize(io, val, tag, level = 0) io.write " " * level if val.is_a?(ONIX::TextWithAttributes) io.write "#{tag}[#{val.attributes.to_a.map { |k, v| "#{k}: #{v.code}(#{v.human})" }.join(", ")}]: #{val.to_s}\n" else io.write "#{tag}: #{val}\n" end end |