Class: ProformaXML::TransformTask
- Inherits:
-
ServiceBase
- Object
- ServiceBase
- ProformaXML::TransformTask
- Defined in:
- lib/proformaxml/services/transform_task.rb
Instance Method Summary collapse
-
#initialize(task:, from_version:, to_version:) ⇒ TransformTask
constructor
A new instance of TransformTask.
- #perform ⇒ Object
Methods inherited from ServiceBase
Constructor Details
#initialize(task:, from_version:, to_version:) ⇒ TransformTask
Returns a new instance of TransformTask.
7 8 9 10 11 12 |
# File 'lib/proformaxml/services/transform_task.rb', line 7 def initialize(task:, from_version:, to_version:) super() @task = task @from_version = from_version @to_version = to_version end |
Instance Method Details
#perform ⇒ Object
14 15 16 17 18 19 20 21 |
# File 'lib/proformaxml/services/transform_task.rb', line 14 def perform if SCHEMA_VERSIONS.include?(@from_version) && SCHEMA_VERSIONS.include?(@to_version) method_name = "transform_from_#{@from_version.tr('.', '_')}_to_#{@to_version.tr('.', '_')}" send(method_name) if defined? method_name end end |