module Eancom module Edifact class Document def initialize @envelope = Envelope.new @message = Message.new end def envelope(&block) yield(@envelope) end def message(name, &block) @message.name = name yield(@message) end def to_s stream = "" stream << @envelope.to_s stream << @message.to_s stream end end end end