Class: Slaw::LifecycleEvent
- Inherits:
-
Object
- Object
- Slaw::LifecycleEvent
- Includes:
- Namespace
- Defined in:
- lib/slaw/lifecycle_event.rb
Overview
An event in the lifecycle of an act
Constant Summary
Constants included from Namespace
Instance Attribute Summary collapse
-
#date ⇒ Object
Date of the event.
-
#source ⇒ Object
the source of the event, an XML reference element.
-
#type ⇒ Object
type of the event.
Instance Method Summary collapse
-
#initialize(element) ⇒ LifecycleEvent
constructor
A new instance of LifecycleEvent.
Constructor Details
#initialize(element) ⇒ LifecycleEvent
Returns a new instance of LifecycleEvent.
15 16 17 18 19 20 21 |
# File 'lib/slaw/lifecycle_event.rb', line 15 def initialize(element) @date = element['date'] @type = element['type'] source_id = element['source'][1..-1] @source = element.document.at_xpath("//a:references/*[@id=\"#{source_id}\"]", a: NS) end |
Instance Attribute Details
#date ⇒ Object
Date of the event
7 8 9 |
# File 'lib/slaw/lifecycle_event.rb', line 7 def date @date end |
#source ⇒ Object
the source of the event, an XML reference element
13 14 15 |
# File 'lib/slaw/lifecycle_event.rb', line 13 def source @source end |
#type ⇒ Object
type of the event
10 11 12 |
# File 'lib/slaw/lifecycle_event.rb', line 10 def type @type end |