Sha256: c624ea3dabaef3a42f457a73d396d7b333dde9e4f6533a50a52f1e42559f2461

Contents?: true

Size: 550 Bytes

Versions: 7

Compression:

Stored size: 550 Bytes

Contents

module AdaptivePayments
  class ResponseEnvelope < JsonModel
    attribute :ack_code,        String,   :param => "ack"
    attribute :build,           String,   :param => "build"
    attribute :correlation_id,  String,   :param => "correlationId"
    attribute :time,            DateTime, :param => "timestamp"

    ["Success", "Failure", "Warning", "SuccessWithWarning", "FailureWithWarning"].each do |ack|
      method = ack.split(/(?=[A-Z])/).map{ |w| w.downcase }.join("_") + "?"
      define_method(method) { ack_code == ack }
    end
  end
end

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
creative-pp-adaptive-1.1.1 lib/pp-adaptive/types/response_envelope.rb
pp-adaptive-1.0.0 lib/pp-adaptive/types/response_envelope.rb
pp-adaptive-0.0.6 lib/pp-adaptive/types/response_envelope.rb
pp-adaptive-0.0.5 lib/pp-adaptive/types/response_envelope.rb
pp-adaptive-0.0.4 lib/pp-adaptive/types/response_envelope.rb
pp-adaptive-0.0.3 lib/pp-adaptive/types/response_envelope.rb
pp-adaptive-0.0.2 lib/pp-adaptive/types/response_envelope.rb