Class: Matterhorn::WorkflowInstance

Inherits:
Object
  • Object
show all
Defined in:
lib/matterhorn/workflow_instance.rb

Overview

Matterhorn::WorkflowInstance ===

Constant Summary collapse

XML_NS_WORKFLOW =

———————————————————————— const definitions —

"http://workflow.opencastproject.org"

Instance Method Summary collapse

Constructor Details

#initialize(xml) ⇒ WorkflowInstance

————————————————————————— initialization —



21
22
23
# File 'lib/matterhorn/workflow_instance.rb', line 21

def initialize(xml)
  @document = Nokogiri::XML(xml)
end

Instance Method Details

#idObject

——————————————————————————— methodes —



28
29
30
# File 'lib/matterhorn/workflow_instance.rb', line 28

def id
  @document.xpath('/nsw:workflow/@id', {"nsw" => XML_NS_WORKFLOW}).first.value
end

#stateObject



33
34
35
# File 'lib/matterhorn/workflow_instance.rb', line 33

def state
  @document.xpath('/nsw:workflow/@state', {"nsw" => XML_NS_WORKFLOW}).first.value
end

#templateObject



38
39
40
# File 'lib/matterhorn/workflow_instance.rb', line 38

def template
  @document.xpath('/nsw:workflow/nsw:template', {"nsw" => XML_NS_WORKFLOW}).first.content       
end

#to_xmlObject



43
44
45
# File 'lib/matterhorn/workflow_instance.rb', line 43

def to_xml
  @document.to_xml
end