Sha256: de59ab3b3a4ba93bd4a8befaa4cb69d4024fe823631e4162aabac9f0f81595bb

Contents?: true

Size: 526 Bytes

Versions: 50

Compression:

Stored size: 526 Bytes

Contents

module Slaw
  # An event in the lifecycle of an act
  class LifecycleEvent
    include Slaw::Namespace

    # Date of the event
    attr_accessor :date

    # type of the event
    attr_accessor :type

    # the source of the event, an XML reference element
    attr_accessor :source

    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
  end
end

Version data entries

50 entries across 50 versions & 1 rubygems

Version Path
slaw-1.0.0.alpha.6 lib/slaw/lifecycle_event.rb
slaw-1.0.0.alpha.5 lib/slaw/lifecycle_event.rb
slaw-1.0.0.alpha.4 lib/slaw/lifecycle_event.rb
slaw-1.0.0.alpha.3 lib/slaw/lifecycle_event.rb
slaw-1.0.0.alpha.2 lib/slaw/lifecycle_event.rb
slaw-1.0.0.alpha.1 lib/slaw/lifecycle_event.rb
slaw-0.17.2 lib/slaw/lifecycle_event.rb
slaw-0.17.1 lib/slaw/lifecycle_event.rb
slaw-0.17.0 lib/slaw/lifecycle_event.rb
slaw-0.16.0 lib/slaw/lifecycle_event.rb
slaw-0.15.2 lib/slaw/lifecycle_event.rb
slaw-0.15.1 lib/slaw/lifecycle_event.rb
slaw-0.15.0 lib/slaw/lifecycle_event.rb
slaw-0.14.2 lib/slaw/lifecycle_event.rb
slaw-0.14.1 lib/slaw/lifecycle_event.rb
slaw-0.14.0 lib/slaw/lifecycle_event.rb
slaw-0.13.0 lib/slaw/lifecycle_event.rb
slaw-0.12.0 lib/slaw/lifecycle_event.rb
slaw-0.11.0 lib/slaw/lifecycle_event.rb
slaw-0.10.1 lib/slaw/lifecycle_event.rb