Class: XES::Document
- Inherits:
-
Object
- Object
- XES::Document
- Defined in:
- lib/xes/document.rb
Overview
Document is a class for XES event log doucment.
Instance Attribute Summary collapse
-
#log ⇒ Log
Log element.
Instance Method Summary collapse
- #==(other) ⇒ Object (also: #eql?) private
-
#format ⇒ REXML::Document
Format as a XML document.
-
#formattable? ⇒ Boolean
Return true if the document is formattable.
- #hash ⇒ Object private
-
#initialize(log = nil) ⇒ Document
constructor
A new instance of Document.
Constructor Details
#initialize(log = nil) ⇒ Document
Returns a new instance of Document.
9 10 11 |
# File 'lib/xes/document.rb', line 9 def initialize(log=nil) @log = log end |
Instance Attribute Details
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.
37 38 39 40 |
# File 'lib/xes/document.rb', line 37 def ==(other) return false unless other.kind_of?(self.class) @log == other.log end |
#format ⇒ REXML::Document
Format as a XML document.
27 28 29 30 31 32 33 34 |
# File 'lib/xes/document.rb', line 27 def format raise FormatError.new(self) unless formattable? REXML::Document.new.tap do |doc| doc << REXML::XMLDecl.new doc.elements << @log.format end end |
#formattable? ⇒ Boolean
Return true if the document is formattable.
17 18 19 |
# File 'lib/xes/document.rb', line 17 def formattable? not(@log.nil?) and @log.formattable? 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.
44 45 46 |
# File 'lib/xes/document.rb', line 44 def hash @attributes.hash + @events.hash end |