Class: Slaw::LifecycleEvent

Inherits:
Object
  • Object
show all
Includes:
Namespace
Defined in:
lib/slaw/lifecycle_event.rb

Overview

An event in the lifecycle of an act

Constant Summary

Constants included from Namespace

Namespace::NS

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#dateObject

Date of the event



7
8
9
# File 'lib/slaw/lifecycle_event.rb', line 7

def date
  @date
end

#sourceObject

the source of the event, an XML reference element



13
14
15
# File 'lib/slaw/lifecycle_event.rb', line 13

def source
  @source
end

#typeObject

type of the event



10
11
12
# File 'lib/slaw/lifecycle_event.rb', line 10

def type
  @type
end