Class: XES::Event
- Inherits:
-
Object
- Object
- XES::Event
- Includes:
- EventAttributeAccessor
- Defined in:
- lib/xes/event.rb
Overview
XESEvent represents “event” element of XES.
Instance Attribute Summary collapse
-
#attributes ⇒ Array<Attribute>
Event attributes.
Attributes included from EventAttributeAccessor
#concept_instance, #concept_name, #cost_currency, #cost_total, #identity_id, #lifecycle_transition, #org_group, #org_resource, #org_role, #semantic_modelReference, #time_timestamp
Instance Method Summary collapse
- #==(other) ⇒ Object (also: #eql?) private
-
#format ⇒ REXML::Element
Format as a XML element.
-
#formattable? ⇒ Boolean
Return true if the element is formattable.
- #hash ⇒ Object private
-
#initialize(attributes = []) ⇒ Event
constructor
Create a XES event.
Methods included from AttributeAccessor
Constructor Details
#initialize(attributes = []) ⇒ Event
Create a XES event.
14 15 16 |
# File 'lib/xes/event.rb', line 14 def initialize(attributes=[]) @attributes = attributes end |
Instance Attribute Details
#attributes ⇒ Array<Attribute>
Returns event attributes.
8 9 10 |
# File 'lib/xes/event.rb', line 8 def attributes @attributes end |
Instance Method Details
#==(other) ⇒ Object Also known as: eql?
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
39 40 41 42 |
# File 'lib/xes/event.rb', line 39 def ==(other) return false unless other.kind_of?(self.class) @attributes == other.attributes end |
#format ⇒ REXML::Element
Format as a XML element.
30 31 32 33 34 35 36 |
# File 'lib/xes/event.rb', line 30 def format REXML::Element.new("event").tap do |event| @attributes.each do |attribute| event.elements << attribute.format if attribute.formattable? end end end |
#formattable? ⇒ Boolean
Return true if the element is formattable.
22 23 24 |
# File 'lib/xes/event.rb', line 22 def formattable? not(@attributes.empty?) end |
#hash ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
46 47 48 |
# File 'lib/xes/event.rb', line 46 def hash @attributes.hash end |