Class: Document::Data

Inherits:
Object
  • Object
show all
Defined in:
lib/document/data.rb

Overview

Input or output data

value - the data value or a (possibly nested) list of data values

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value = nil, annotation = nil) ⇒ Data

Returns a new instance of Data.



9
10
11
12
# File 'lib/document/data.rb', line 9

def initialize(value=nil, annotation=nil)
	@value = value
	@annotation = annotation
end

Instance Attribute Details

#annotationObject

Returns the value of attribute annotation.



7
8
9
# File 'lib/document/data.rb', line 7

def annotation
  @annotation
end

#valueObject

Returns the value of attribute value.



7
8
9
# File 'lib/document/data.rb', line 7

def value
  @value
end

Instance Method Details

#==(other) ⇒ Object



18
19
20
# File 'lib/document/data.rb', line 18

def ==(other)
	@value == other.value and @annotation == other.annotation
end

#eql?(other) ⇒ Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/document/data.rb', line 14

def eql?(other)
	@value.eql?(other.value) and @annotation.eql?(other.annotation)
end