Class: WfsRails::WorkflowParser
- Inherits:
-
Object
- Object
- WfsRails::WorkflowParser
- Defined in:
- lib/wfs_rails/workflow_parser.rb
Overview
Parsing Workflow creation request
Instance Attribute Summary collapse
-
#druid ⇒ Object
readonly
Returns the value of attribute druid.
-
#repository ⇒ Object
readonly
Returns the value of attribute repository.
-
#xml_request ⇒ Object
readonly
Returns the value of attribute xml_request.
Instance Method Summary collapse
- #create_workflows ⇒ Array
-
#initialize(request_body, druid, repository) ⇒ WorkflowParser
constructor
A new instance of WorkflowParser.
Constructor Details
#initialize(request_body, druid, repository) ⇒ WorkflowParser
Returns a new instance of WorkflowParser.
11 12 13 14 15 |
# File 'lib/wfs_rails/workflow_parser.rb', line 11 def initialize(request_body, druid, repository) @xml_request = Nokogiri::XML(request_body) @druid = druid @repository = repository end |
Instance Attribute Details
#druid ⇒ Object (readonly)
Returns the value of attribute druid.
5 6 7 |
# File 'lib/wfs_rails/workflow_parser.rb', line 5 def druid @druid end |
#repository ⇒ Object (readonly)
Returns the value of attribute repository.
5 6 7 |
# File 'lib/wfs_rails/workflow_parser.rb', line 5 def repository @repository end |
#xml_request ⇒ Object (readonly)
Returns the value of attribute xml_request.
5 6 7 |
# File 'lib/wfs_rails/workflow_parser.rb', line 5 def xml_request @xml_request end |
Instance Method Details
#create_workflows ⇒ Array
19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/wfs_rails/workflow_parser.rb', line 19 def create_workflows processes.map do |process| Workflow.create(datastream: workflow_id, druid: druid, process: process.name, status: process.status, lane_id: process.lane_id, repository: repository, lifecycle: process.lifecycle ) end end |