Class: Headache::Record::BatchHeader
- Includes:
- Definition::BatchHeader
- Defined in:
- lib/headache/record/batch_header.rb
Instance Attribute Summary collapse
-
#batch ⇒ Object
Returns the value of attribute batch.
-
#document ⇒ Object
Returns the value of attribute document.
Instance Method Summary collapse
-
#initialize(batch = nil, document = nil) ⇒ BatchHeader
constructor
A new instance of BatchHeader.
- #parse_fields(record_string) ⇒ Object
Methods inherited from Base
fields, #normalize_field_value, normalize_field_value, #parse, parse_fields, parse_fields_normalize, #to_h
Constructor Details
#initialize(batch = nil, document = nil) ⇒ BatchHeader
Returns a new instance of BatchHeader.
15 16 17 18 |
# File 'lib/headache/record/batch_header.rb', line 15 def initialize(batch = nil, document = nil) @batch = batch @document = document end |
Instance Attribute Details
#batch ⇒ Object
Returns the value of attribute batch.
6 7 8 |
# File 'lib/headache/record/batch_header.rb', line 6 def batch @batch end |
#document ⇒ Object
Returns the value of attribute document.
6 7 8 |
# File 'lib/headache/record/batch_header.rb', line 6 def document @document end |
Instance Method Details
#parse_fields(record_string) ⇒ Object
20 21 22 23 24 |
# File 'lib/headache/record/batch_header.rb', line 20 def parse_fields(record_string) fields = super type = Headache::Batch.type_from_service_code(fields.delete :service_code) fields.merge(type: type) end |