Class: EdifactConverter::Difference
- Inherits:
-
Object
- Object
- EdifactConverter::Difference
- Defined in:
- lib/edifact_converter/difference.rb
Constant Summary collapse
- ATTRIBUTES =
[:source, :facit, :kind, :type, :message]
Instance Method Summary collapse
- #eql?(diff) ⇒ Boolean
-
#initialize(options) ⇒ Difference
constructor
A new instance of Difference.
- #to_s ⇒ Object
Constructor Details
#initialize(options) ⇒ Difference
Returns a new instance of Difference.
12 13 14 15 16 17 18 19 |
# File 'lib/edifact_converter/difference.rb', line 12 def initialize() .fetch(:type) { |key| [key] = :errors } .each do |name, value| if ATTRIBUTES.include? name send "#{name}=", value end end end |
Instance Method Details
#eql?(diff) ⇒ Boolean
21 22 23 24 25 26 27 28 |
# File 'lib/edifact_converter/difference.rb', line 21 def eql?(diff) return false unless diff.kind == kind if kind == :unt diff.source == source && diff.facit == facit else diff.source.name == source.name && diff.facit.name == facit.name end end |
#to_s ⇒ Object
30 31 32 |
# File 'lib/edifact_converter/difference.rb', line 30 def to_s "#{source.path} afviger fra #{facit.path} ved at #{kind} af typen #{type} og meddelelsen #{}" end |