class ChupaText::Decomposers::OpenDocumentPresentation

Public Class Methods

new(options={}) click to toggle source
Calls superclass method
# File lib/chupa-text/decomposers/opendocument-presentation.rb, line 24
def initialize(options={})
  super
  @extension = "odp"
  @mime_type = "application/vnd.oasis.opendocument.presentation"
end

Private Instance Methods

finish_decompose(context) { |metadata| ... } click to toggle source
# File lib/chupa-text/decomposers/opendocument-presentation.rb, line 37
def finish_decompose(context, &block)
  metadata = TextData.new("", source_data: context[:data])
  context[:attributes].each do |name, value|
    metadata[name] = value
  end
  yield(metadata)

  (context[:slides] || []).each_with_index do |slide, i|
    text = slide[:text]
    text_data = TextData.new(text, source_data: context[:data])
    text_data["index"] = i
    yield(text_data)
  end
end
log_tag() click to toggle source
# File lib/chupa-text/decomposers/opendocument-presentation.rb, line 52
def log_tag
  "#{super}[presentation]"
end
process_content(entry, context, &block) click to toggle source
# File lib/chupa-text/decomposers/opendocument-presentation.rb, line 31
def process_content(entry, context, &block)
  context[:slides] = []
  listener = SlidesListener.new(context[:slides])
  parse(entry.file_data, listener)
end