# frozen_string_literal: true module Axlsx # The core object for the package. # @note Packages manage their own core object. # @see Package#core class Core # Creates a new Core object. # @option options [String] creator # @option options [Time] created def initialize(options = {}) @creator = options[:creator] || 'axlsx' @created = options[:created] end # The author of the document. By default this is 'axlsx' # @return [String] attr_accessor :creator # Creation time of the document. If nil, the current time will be used. attr_accessor :created # serializes the core.xml document # @return [String] def to_xml_string(str = +'') str << '' str << '' str << '' << creator << '' str << '' << (created || Time.now).strftime('%Y-%m-%dT%H:%M:%S') << 'Z' str << '0' str << '' end end end