Class: DineroMailIpn::Notification

Inherits:
Object
  • Object
show all
Defined in:
lib/dinero_mail_ipn/notification_parser.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type, raw_operations, options = {}) ⇒ Notification

Returns a new instance of Notification.

Raises:

  • (ArgumentError)


63
64
65
66
67
68
69
70
71
72
# File 'lib/dinero_mail_ipn/notification_parser.rb', line 63

def initialize(type, raw_operations, options = {})
  raise ArgumentError, "No operations received" if (raw_operations.empty? || raw_operations.nil?)

  @operations = raw_operations.inject([]) do |result, (type, id)|
    result << Operation.new(type, id)
    result
  end

  @type = type
end

Instance Attribute Details

#operationsObject

Returns the value of attribute operations.



61
62
63
# File 'lib/dinero_mail_ipn/notification_parser.rb', line 61

def operations
  @operations
end

#typeObject

Returns the value of attribute type.



61
62
63
# File 'lib/dinero_mail_ipn/notification_parser.rb', line 61

def type
  @type
end