class ChupaText::Decomposers::OpenDocumentText

Public Class Methods

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

Private Instance Methods

finish_decompose(context) { |text_data| ... } click to toggle source
# File lib/chupa-text/decomposers/opendocument-text.rb, line 37
def finish_decompose(context, &block)
  text_data = TextData.new(context[:text] || "",
                           source_data: context[:data])
  context[:attributes].each do |name, value|
    text_data[name] = value
  end
  yield(text_data)
end
log_tag() click to toggle source
# File lib/chupa-text/decomposers/opendocument-text.rb, line 46
def log_tag
  "#{super}[text]"
end
process_content(entry, context, &block) click to toggle source
# File lib/chupa-text/decomposers/opendocument-text.rb, line 31
def process_content(entry, context, &block)
  context[:text] = ""
  listener = TextListener.new(context[:text])
  parse(entry.file_data, listener)
end