Sha256: 84ead52ad6b0f0c6cfe47bc4530ee1a67403b88b4975f44c94a74f9305f0b799

Contents?: true

Size: 601 Bytes

Versions: 15

Compression:

Stored size: 601 Bytes

Contents

module Absa
  module H2h
    module Transmission
    
      class Document < Set
        
        class Header < Record; end
        class Trailer < Record; end
        
        def self.from_s(string, transmission_type)
          options = self.hash_from_s(string, transmission_type)
          self.build(options[:data])
        end
        
        def to_file!(filename)
          File.open(destination, 'w') {|file| file.write(self.to_s) }
        end
        
        def from_file!(filename)
          self.from_s(File.open(filename, "rb").read)
        end
    
      end
    end    
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
absa-h2h-0.1.11 lib/absa-h2h/transmission/document.rb
absa-h2h-0.1.10 lib/absa-h2h/transmission/document.rb
absa-h2h-0.1.9 lib/absa-h2h/transmission/document.rb
absa-h2h-0.1.8 lib/absa-h2h/transmission/document.rb
absa-h2h-0.1.7 lib/absa-h2h/transmission/document.rb
absa-h2h-0.1.6 lib/absa-h2h/transmission/document.rb
absa-h2h-0.1.5 lib/absa-h2h/transmission/document.rb
absa-h2h-0.1.4 lib/absa-h2h/transmission/document.rb
absa-h2h-0.1.3 lib/absa-h2h/transmission/document.rb
absa-h2h-0.1.2 lib/absa-h2h/transmission/document.rb
absa-h2h-0.1.1 lib/absa-h2h/transmission/document.rb
absa-h2h-0.1.0 lib/absa-h2h/transmission/document.rb
absa-h2h-0.0.13 lib/absa-h2h/transmission/document.rb
absa-h2h-0.0.12 lib/absa-h2h/transmission/document.rb
absa-h2h-0.0.11 lib/absa-h2h/transmission/document.rb