Class: Bambora::BatchUpload::SendSingleBatch
- Inherits:
-
Object
- Object
- Bambora::BatchUpload::SendSingleBatch
- Defined in:
- lib/bambora/batch_upload/send_single_batch.rb
Instance Attribute Summary collapse
-
#file_path ⇒ Object
Returns the value of attribute file_path.
-
#process_date ⇒ Object
Returns the value of attribute process_date.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(file_path, process_date) ⇒ SendSingleBatch
constructor
A new instance of SendSingleBatch.
Constructor Details
#initialize(file_path, process_date) ⇒ SendSingleBatch
Returns a new instance of SendSingleBatch.
10 11 12 13 |
# File 'lib/bambora/batch_upload/send_single_batch.rb', line 10 def initialize(file_path,process_date) @file_path = file_path @process_date = process_date end |
Instance Attribute Details
#file_path ⇒ Object
Returns the value of attribute file_path.
7 8 9 |
# File 'lib/bambora/batch_upload/send_single_batch.rb', line 7 def file_path @file_path end |
#process_date ⇒ Object
Returns the value of attribute process_date.
8 9 10 |
# File 'lib/bambora/batch_upload/send_single_batch.rb', line 8 def process_date @process_date end |
Instance Method Details
#call ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/bambora/batch_upload/send_single_batch.rb', line 15 def call begin service = BeanstreamSendBatch.new(file_path, process_date, process_now) batch_id = service.send unless batch_id.nil? yield(batch_id) if block_given? end rescue BatchUploadError #reraise error raise rescue JSON::ParserError => err raise ConnectionError, "JSON parse Error: #{err.}" rescue => err #most likely api connection error raise ConnectionError, "#{err.class}: #{err.}" end end |