class Xcplayground::XctimelineFile
Represent a .xctimeline file on disc
Attributes
filename[R]
version[R]
Public Class Methods
new(filename = 'timeline.xctimeline', version = '3.0')
click to toggle source
# File lib/xcplayground/xctimeline_file.rb, line 9 def initialize(filename = 'timeline.xctimeline', version = '3.0') @filename = filename @version = version end
Public Instance Methods
save(path)
click to toggle source
# File lib/xcplayground/xctimeline_file.rb, line 14 def save(path) file = File.join(path, filename) File.open(file, 'w') do |f| f.puts to_s end end
to_s()
click to toggle source
# File lib/xcplayground/xctimeline_file.rb, line 21 def to_s xml = Builder::XmlMarkup.new(indent: 2) xml.instruct! :xml, version: '1.0', encoding: 'UTF-8' xml.Timeline(version: version) do |tl| tl.TimelineItems {} end xml.target! end