Class: Nanaimo::Writer
- Inherits:
-
Object
- Object
- Nanaimo::Writer
- Defined in:
- lib/nanaimo/writer.rb,
lib/nanaimo/writer/xml.rb,
lib/nanaimo/writer/pbxproj.rb
Overview
Transforms native ruby objects or Plist objects into their ASCII Plist string representation.
Direct Known Subclasses
Defined Under Namespace
Classes: PBXProjWriter, UnsupportedPlistTypeError, XMLWriter
Constant Summary collapse
- UTF8 =
The magic comment that denotes a UTF8-encoded plist.
"// !$*UTF8*$!\n"
Instance Method Summary collapse
-
#initialize(plist, pretty: true, output: ::String.new, strict: true) ⇒ Writer
constructor
A new instance of Writer.
-
#write ⇒ Object
Writes the plist to the given output.
Constructor Details
#initialize(plist, pretty: true, output: ::String.new, strict: true) ⇒ Writer
Returns a new instance of Writer.
35 36 37 38 39 40 41 42 |
# File 'lib/nanaimo/writer.rb', line 35 def initialize(plist, pretty: true, output: ::String.new, strict: true) @plist = plist @pretty = pretty @output = output @indent = 0 @newlines = true @strict = strict end |
Instance Method Details
#write ⇒ Object
Writes the plist to the given output.
46 47 48 49 50 |
# File 'lib/nanaimo/writer.rb', line 46 def write write_utf8 write_object(@plist.root_object) write_newline end |