class EdifactConverter::Message
Constants
- ATTRIBUTES
Public Class Methods
from_syntax_error(error)
click to toggle source
# File lib/edifact_converter/message.rb, line 19 def self.from_syntax_error(error) position = EdifactConverter::EDI2XML11::Position.new(error.line, error.column) self.new(position: position, text: error.to_s, source: :xml) end
new(options)
click to toggle source
# File lib/edifact_converter/message.rb, line 13 def initialize(options) self.position = options[:position] self.text = options.fetch(:text, "Ukendt fejl") self.source = options.fetch(:source, :edifact) end
Public Instance Methods
to_s()
click to toggle source
# File lib/edifact_converter/message.rb, line 24 def to_s "#{source.to_s.capitalize}: #{text} #{position}" end