Class: Matterhorn::WorkflowInstance
- Inherits:
-
Object
- Object
- Matterhorn::WorkflowInstance
- 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
-
#id ⇒ Object
——————————————————————————— methodes —.
-
#initialize(xml) ⇒ WorkflowInstance
constructor
————————————————————————— initialization —.
- #state ⇒ Object
- #template ⇒ Object
- #to_xml ⇒ Object
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
#id ⇒ Object
——————————————————————————— 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 |
#state ⇒ Object
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 |
#template ⇒ Object
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_xml ⇒ Object
43 44 45 |
# File 'lib/matterhorn/workflow_instance.rb', line 43 def to_xml @document.to_xml end |