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.
150 151 152 153 154 155 156 157 158 159 160 161 |
# File 'lib/rflow/message.rb', line 150 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.
145 146 147 |
# File 'lib/rflow/message.rb', line 145 def completed_at @completed_at end |
#component_instance_uuid ⇒ String (readonly)
The UUID of the component doing the processing.
139 140 141 |
# File 'lib/rflow/message.rb', line 139 def component_instance_uuid @component_instance_uuid end |
#context ⇒ String
Arbitrary context bytes.
148 149 150 |
# File 'lib/rflow/message.rb', line 148 def context @context end |
#started_at ⇒ String (readonly)
The time processing started, in XML schema format.
142 143 144 |
# File 'lib/rflow/message.rb', line 142 def started_at @started_at end |
Instance Method Details
#to_hash ⇒ Hash
Represent the processing event as a hash.
165 166 167 168 169 170 171 172 |
# File 'lib/rflow/message.rb', line 165 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 |