Sha256: 07fb0837437eeabb0f6fae8e1fe073e8c2464cbc4a6b6e3f9130fd3f8fe8a64e

Contents?: true

Size: 614 Bytes

Versions: 2

Compression:

Stored size: 614 Bytes

Contents

require 'happymapper'
module Dineromail
  class Notification
    include HappyMapper
    
    tag 'OPERACION'
    element :transaction_id, Integer, :tag => 'ID'
    element :type, String, :tag => 'TIPO'
    
    def status_report
      unless @status_report
        @status_report = StatusReport.get_report_for(transaction_id)
      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

2 entries across 2 versions & 1 rubygems

Version Path
dineromail-0.1.1 lib/dineromail/notification.rb
dineromail-0.1.0 lib/dineromail/notification.rb