Sha256: 312265b68a5035dac26e694cf4be9fe95a426552636842f06a20017aae1745d8

Contents?: true

Size: 495 Bytes

Versions: 6

Compression:

Stored size: 495 Bytes

Contents

module PostalMethods
  module DocumentProcessor
   
   def document=(doc)
     unless doc.class == File
       doc = open(doc)
     end
     
     self.to_send = {} if self.to_send.nil?
     
     self.to_send[:extension] = doc.path.to_s.split('.').last
     self.to_send[:bytes] = doc.read
     self.to_send[:name] = File.basename(doc.path)
     self.to_send[:file_obj] = doc
   end

   def document?
     true unless self.to_send.nil?
   end

   def document
     self.to_send
   end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
postalmethods-1.1.4 lib/postalmethods/document_processor.rb
postalmethods-1.1.3 lib/postalmethods/document_processor.rb
postalmethods-1.0.0 lib/postalmethods/document_processor.rb
postalmethods-1.0.1 lib/postalmethods/document_processor.rb
postalmethods-1.1.1 lib/postalmethods/document_processor.rb
postalmethods-1.1.0 lib/postalmethods/document_processor.rb