Class: Absa::H2h::Transmission::Document
- Inherits:
-
Set
- Object
- Set
- Absa::H2h::Transmission::Document
show all
- Defined in:
- lib/absa-h2h/transmission/document.rb
Defined Under Namespace
Classes: Header, Trailer
Instance Attribute Summary
Attributes inherited from Set
#records
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Set
build, for_record, hash_from_s, #header, #initialize, is_trailer_record?, layout_rules, module_name, partial_class_name, process_record, record_type, record_types, #to_s, #trailer, trailer_id, #transactions, #validate!
Class Method Details
.from_s(string, transmission_type) ⇒ Object
10
11
12
13
|
# File 'lib/absa-h2h/transmission/document.rb', line 10
def self.from_s(string, transmission_type)
options = self.hash_from_s(string, transmission_type)
self.build(options[:data])
end
|
Instance Method Details
#from_file!(filename) ⇒ Object
19
20
21
|
# File 'lib/absa-h2h/transmission/document.rb', line 19
def from_file!(filename)
self.from_s(File.open(filename, "rb").read)
end
|
#to_file!(filename) ⇒ Object
15
16
17
|
# File 'lib/absa-h2h/transmission/document.rb', line 15
def to_file!(filename)
File.open(destination, 'w') {|file| file.write(self.to_s) }
end
|