Class: Paperclip::DocsplitProcessor

Inherits:
Processor
  • Object
show all
Defined in:
lib/docsplit-paperclip-processor.rb

Direct Known Subclasses

DocsplitImage, DocsplitPdf, DocsplitText

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(file, options = {}, attachment = nil) ⇒ DocsplitProcessor

Returns a new instance of DocsplitProcessor.



9
10
11
12
13
14
15
# File 'lib/docsplit-paperclip-processor.rb', line 9

def initialize(file, options = {}, attachment = nil)
  super
  @src        = file
  @options    = options
  @attachment = attachment
  @basename   = File.basename(@file.path, '.*')
end

Instance Attribute Details

#attachmentObject

Returns the value of attribute attachment.



7
8
9
# File 'lib/docsplit-paperclip-processor.rb', line 7

def attachment
  @attachment
end

#optionsObject

Returns the value of attribute options.



7
8
9
# File 'lib/docsplit-paperclip-processor.rb', line 7

def options
  @options
end

#srcObject

Returns the value of attribute src.



7
8
9
# File 'lib/docsplit-paperclip-processor.rb', line 7

def src
  @src
end

Instance Method Details

#src_pathObject



17
18
19
# File 'lib/docsplit-paperclip-processor.rb', line 17

def src_path
  File.expand_path(@src.path)
end