Class: EdifactConverter::Result

Inherits:
Object
  • Object
show all
Includes:
ConverterMethods
Defined in:
lib/edifact_converter/result.rb

Constant Summary collapse

ATTRIBUTES =
[:xml, :ast, :edifact, :properties, :source_format]

Instance Method Summary collapse

Methods included from ConverterMethods

#binary, #convert, #format_edifact, #html, #verify

Constructor Details

#initialize(options) ⇒ Result

Returns a new instance of Result.



16
17
18
19
20
21
22
# File 'lib/edifact_converter/result.rb', line 16

def initialize(options)
  options.each do |key, value|
    if ATTRIBUTES.member? key.to_sym
      self.send "#{key}=", value
    end
  end
end

Instance Method Details

#propertiesObject



24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/edifact_converter/result.rb', line 24

def properties
  @properties ||= Hash.new do |hash,key|
    case key
    when :errors
      hash[key] = []
    when :warnings
      hash[key] = []
    else
      nil
    end
  end
end