Class: HmrcIrMarkCalculator

Inherits:
Object
  • Object
show all
Extended by:
IrMarkLogger
Defined in:
lib/hmrc_ir_mark_calculator.rb

Overview

A Java wrapper that creates an IRmark from an HMRC submission file It accepts the path to the file, which should contain the same contents being sent to HMRC, inlcuding the GovTalkMessage, and body

It needs the absolute path to the Full CT600 File that has been prepared for submission. Providing a relative path may not work as expected.

Instance Attribute Summary collapse

Attributes included from IrMarkLogger

#logger

Instance Method Summary collapse

Constructor Details

#initialize(file_path) ⇒ HmrcIrMarkCalculator

Returns a new instance of HmrcIrMarkCalculator.



17
18
19
# File 'lib/hmrc_ir_mark_calculator.rb', line 17

def initialize(file_path)
  @file_path = file_path
end

Instance Attribute Details

#file_pathObject (readonly)

Returns the value of attribute file_path.



13
14
15
# File 'lib/hmrc_ir_mark_calculator.rb', line 13

def file_path
  @file_path
end

Instance Method Details

#runObject



21
22
23
24
25
26
27
# File 'lib/hmrc_ir_mark_calculator.rb', line 21

def run
  self.class.logger.info("Using #{cmd} to generate IRmark for file #{file_path}")

  create_mark
rescue StandardError => e
  handle_error(e.message)
end