Class: RFlow::Message::ProcessingEvent
- Inherits:
-
Object
- Object
- RFlow::Message::ProcessingEvent
- Defined in:
- lib/rflow/message.rb
Overview
One processing event in the message’s provenance.
Instance Attribute Summary collapse
-
#completed_at ⇒ String
The time processing ended, in XML schema format.
-
#component_instance_uuid ⇒ String
readonly
The UUID of the component doing the processing.
-
#context ⇒ String
Arbitrary context bytes.
-
#started_at ⇒ String
readonly
The time processing started, in XML schema format.
Instance Method Summary collapse
-
#initialize(component_instance_uuid, started_at = nil, completed_at = nil, context = nil) ⇒ ProcessingEvent
constructor
A new instance of ProcessingEvent.
-
#to_hash ⇒ Hash
Represent the processing event as a hash.
Constructor Details
#initialize(component_instance_uuid, started_at = nil, completed_at = nil, context = nil) ⇒ ProcessingEvent
Returns a new instance of ProcessingEvent.
146 147 148 149 150 151 152 153 154 155 156 157 |
# File 'lib/rflow/message.rb', line 146 def initialize(component_instance_uuid, started_at = nil, completed_at = nil, context = nil) @component_instance_uuid = component_instance_uuid @started_at = case started_at when String; Time.xmlschema(started_at) when Time; started_at else nil; end @completed_at = case completed_at when String; Time.xmlschema(completed_at) when Time; completed_at else nil; end @context = context end |
Instance Attribute Details
#completed_at ⇒ String
The time processing ended, in XML schema format.
141 142 143 |
# File 'lib/rflow/message.rb', line 141 def completed_at @completed_at end |
#component_instance_uuid ⇒ String (readonly)
The UUID of the component doing the processing.
135 136 137 |
# File 'lib/rflow/message.rb', line 135 def component_instance_uuid @component_instance_uuid end |
#context ⇒ String
Arbitrary context bytes.
144 145 146 |
# File 'lib/rflow/message.rb', line 144 def context @context end |
#started_at ⇒ String (readonly)
The time processing started, in XML schema format.
138 139 140 |
# File 'lib/rflow/message.rb', line 138 def started_at @started_at end |
Instance Method Details
#to_hash ⇒ Hash
Represent the processing event as a hash.
161 162 163 164 165 166 167 168 |
# File 'lib/rflow/message.rb', line 161 def to_hash { 'component_instance_uuid' => component_instance_uuid.to_s, 'started_at' => started_at ? started_at.xmlschema(6) : nil, 'completed_at' => completed_at ? completed_at.xmlschema(6) : nil, 'context' => context ? context.to_s : nil, } end |