Sha256: 9e676653d72b0ddc4397d0210dcd54514431ce974f1ec9d5f64851c3e5ff2f0d

Contents?: true

Size: 674 Bytes

Versions: 19

Compression:

Stored size: 674 Bytes

Contents

class Adaptation::Adaptor

  def publish *options

    message_object = nil
    if options.first.is_a?(Adaptation::Message)
      message_object = options.first
    elsif options.first.is_a?(String)
      xml_message = options.first
      message_type = xml_message[1..(xml_message.index(/(>| )/) - 1)]
      message_class = get_class_object(message_type.capitalize)
      message_object = message_class.to_object(xml_message)
    end

    mom = File.new(File.dirname(__FILE__) + '/mom.txt', "a")
    mom.write("#{message_object.to_xml.to_s}\n")
    mom.close
    
    #   configuration = {}
    #   configuration.update(options.pop) if options.last.is_a?(Hash)

  end

end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
adaptation-0.0.1 helpers/publish.rb
adaptation-0.0.2 helpers/publish.rb
adaptation-0.0.4 helpers/publish.rb
adaptation-0.0.5 helpers/publish.rb
adaptation-0.0.6 helpers/publish.rb
adaptation-0.0.7 helpers/publish.rb
adaptation-0.0.8 helpers/publish.rb
adaptation-0.0.9 helpers/publish.rb
adaptation-0.1.0 helpers/publish.rb
adaptation-0.0.3 helpers/publish.rb
adaptation-0.1.1 helpers/publish.rb
adaptation-0.1.3 helpers/publish.rb
adaptation-0.1.4 helpers/publish.rb
adaptation-0.1.5 helpers/publish.rb
adaptation-0.1.6 helpers/publish.rb
adaptation-0.1.7 helpers/publish.rb
adaptation-0.1.8 helpers/publish.rb
adaptation-0.1.2 helpers/publish.rb
adaptation-0.1.9 helpers/publish.rb