Sha256: 6c0619ce2a5f9a0b3097cc64547b1417c706ff1391d30d7285025da91ee6d1b3

Contents?: true

Size: 709 Bytes

Versions: 1

Compression:

Stored size: 709 Bytes

Contents

require 'happymapper'
module Dineromail
  class Notification
    include HappyMapper
    
    tag 'OPERACION'
    element :transaction_id, Integer, :tag => 'ID'
    element :type, String, :tag => 'TIPO'
    
    def initialize(options = {})
      @options = options.symbolize_keys
    end
    
    def status_report
      unless @status_report
        @status_report = StatusReport.get_report_for(transaction_id,@options)
      end
      @status_report
    end
    
    def valid_report?
      status_report.valid_report?
    end
    
    def method_missing(symbol, *args)
      unless status_report.operations.empty?
        status_report.operations.first.send(symbol, *args)
      end
    end
    
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
dineromail-0.1.2 lib/dineromail/notification.rb