Class: StreamPoint

Inherits:
Object
  • Object
show all
Defined in:
lib/cpee-logging-xes-yaml/tools.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id = nil) ⇒ StreamPoint

Returns a new instance of StreamPoint.



23
24
25
26
27
28
29
# File 'lib/cpee-logging-xes-yaml/tools.rb', line 23

def initialize(id=nil)
  @id = id
  @value = nil
  @timestamp = Time.now
  @source = nil
  @meta = nil
end

Instance Attribute Details

#idObject

Returns the value of attribute id.



21
22
23
# File 'lib/cpee-logging-xes-yaml/tools.rb', line 21

def id
  @id
end

#metaObject

Returns the value of attribute meta.



21
22
23
# File 'lib/cpee-logging-xes-yaml/tools.rb', line 21

def meta
  @meta
end

#sourceObject

Returns the value of attribute source.



21
22
23
# File 'lib/cpee-logging-xes-yaml/tools.rb', line 21

def source
  @source
end

#timestampObject

Returns the value of attribute timestamp.



21
22
23
# File 'lib/cpee-logging-xes-yaml/tools.rb', line 21

def timestamp
  @timestamp
end

#valueObject

Returns the value of attribute value.



21
22
23
# File 'lib/cpee-logging-xes-yaml/tools.rb', line 21

def value
  @value
end

Instance Method Details

#to_hObject



31
32
33
34
35
36
37
38
39
# File 'lib/cpee-logging-xes-yaml/tools.rb', line 31

def to_h
  tp = { }
  tp['stream:id'] = @id
  tp['stream:value'] = @value
  tp['stream:timestamp'] = @timestamp
  tp['stream:source'] = @source unless @source.nil?
  tp['stream:meta'] = @meta unless @meta.nil?
  tp
end