Class: StreamPoint
- Inherits:
-
Object
- Object
- StreamPoint
- Defined in:
- lib/cpee-logging-xes-yaml/tools.rb
Instance Attribute Summary collapse
-
#meta ⇒ Object
Returns the value of attribute meta.
-
#source ⇒ Object
Returns the value of attribute source.
-
#timestamp ⇒ Object
Returns the value of attribute timestamp.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize ⇒ StreamPoint
constructor
A new instance of StreamPoint.
- #to_h(id) ⇒ Object
Constructor Details
#initialize ⇒ StreamPoint
Returns a new instance of StreamPoint.
6 7 8 9 10 11 |
# File 'lib/cpee-logging-xes-yaml/tools.rb', line 6 def initialize @value = nil @timestamp = Time.now @source = nil @meta = nil end |
Instance Attribute Details
#meta ⇒ Object
Returns the value of attribute meta.
4 5 6 |
# File 'lib/cpee-logging-xes-yaml/tools.rb', line 4 def @meta end |
#source ⇒ Object
Returns the value of attribute source.
4 5 6 |
# File 'lib/cpee-logging-xes-yaml/tools.rb', line 4 def source @source end |
#timestamp ⇒ Object
Returns the value of attribute timestamp.
4 5 6 |
# File 'lib/cpee-logging-xes-yaml/tools.rb', line 4 def @timestamp end |
#value ⇒ Object
Returns the value of attribute value.
4 5 6 |
# File 'lib/cpee-logging-xes-yaml/tools.rb', line 4 def value @value end |
Instance Method Details
#to_h(id) ⇒ Object
13 14 15 16 17 18 19 20 21 |
# File 'lib/cpee-logging-xes-yaml/tools.rb', line 13 def to_h(id) tp = { 'stream:point' => { } } tp['stream:point']['stream:id'] = id tp['stream:point']['stream:value'] = @value tp['stream:point']['stream:timestamp'] = @timestamp tp['stream:point']['stream:source'] = @source unless @source.nil? tp['stream:point']['stream:meta'] = @meta unless @meta.nil? tp end |