Sha256: 66fe5675186602807e085c12c988761cb8b6acd207f504ffa822ff71e526b12a
Contents?: true
Size: 809 Bytes
Versions: 1
Compression:
Stored size: 809 Bytes
Contents
require 'xmlsimple' module Dineromail class Notification attr_reader :transaction_id, :tipo def initialize(transaction_id, tipo = null) @transaction_id = transaction_id @tipo = tipo end def status_report unless @status_report @status_report = StatusReport.new(transaction_id) end @status_report end def self.from_xml(notification_xml) notifications = [] notificaction_data = XmlSimple.xml_in(notification_xml) operations = notificaction_data['OPERACIONES'].first['OPERACION'] operations.each do |operation| tipo = operation['TIPO'].first transaction_id = operation['ID'].first notifications << self.new(transaction_id, tipo) end notifications end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
dineromail-0.0.1 | lib/dineromail/notification.rb |