Sha256: fb00929b14ac6e7d4894538d6c78b7716080cd07558fda4a3abc8a4a443bc0e6

Contents?: true

Size: 443 Bytes

Versions: 29

Compression:

Stored size: 443 Bytes

Contents

class Agilibox::Serializers::AXLSX < Agilibox::Serializers::Base
  def render_inline
    xlsx.to_stream.read.force_encoding("BINARY")
  end

  def render_file(file_path)
    xlsx.serialize(file_path)
  end

  def xlsx
    @xlsx ||= Axlsx::Package.new do |p|
      p.workbook.add_worksheet do |sheet|
        formatted_data.each do |line|
          sheet.add_row(line)
        end
      end

      p.use_shared_strings = true
    end
  end
end

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
agilibox-1.9.20 app/serializers/agilibox/serializers/axlsx.rb
agilibox-1.9.19 app/serializers/agilibox/serializers/axlsx.rb
agilibox-1.9.18 app/serializers/agilibox/serializers/axlsx.rb
agilibox-1.9.17 app/serializers/agilibox/serializers/axlsx.rb
agilibox-1.9.16 app/serializers/agilibox/serializers/axlsx.rb
agilibox-1.9.15 app/serializers/agilibox/serializers/axlsx.rb
agilibox-1.9.14 app/serializers/agilibox/serializers/axlsx.rb
agilibox-1.9.13 app/serializers/agilibox/serializers/axlsx.rb
agilibox-1.9.12 app/serializers/agilibox/serializers/axlsx.rb
agilibox-1.9.11 app/serializers/agilibox/serializers/axlsx.rb
agilibox-1.9.10 app/serializers/agilibox/serializers/axlsx.rb
agilibox-1.9.9 app/serializers/agilibox/serializers/axlsx.rb
agilibox-1.9.8 app/serializers/agilibox/serializers/axlsx.rb
agilibox-1.9.7 app/serializers/agilibox/serializers/axlsx.rb
agilibox-1.9.6 app/serializers/agilibox/serializers/axlsx.rb
agilibox-1.9.5 app/serializers/agilibox/serializers/axlsx.rb
agilibox-1.9.4 app/serializers/agilibox/serializers/axlsx.rb
agilibox-1.9.3 app/serializers/agilibox/serializers/axlsx.rb
agilibox-1.9.1 app/serializers/agilibox/serializers/axlsx.rb
agilibox-1.9.0 app/serializers/agilibox/serializers/axlsx.rb