Sha256: 584fac948df750f26dda69cd5c668ccc2e29d62cd278a8948d4a1a1189d47e24

Contents?: true

Size: 482 Bytes

Versions: 28

Compression:

Stored size: 482 Bytes

Contents

module ActiveFulfillment
  class Response
    attr_reader :params
    attr_reader :message
    attr_reader :test

    def success?
      @success
    end

    def test?
      @test
    end

    def initialize(success, message, params = {}, options = {})
      @success, @message, @params = success, message, params.stringify_keys
      @test = options[:test] || false
    end

    private
    def method_missing(method, *args)
      @params[method.to_s] || super
    end
  end

end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
active_fulfillment-3.0.1 lib/active_fulfillment/response.rb
active_fulfillment-3.0.0.pre8 lib/active_fulfillment/response.rb
active_fulfillment-3.0.0.pre7 lib/active_fulfillment/response.rb
active_fulfillment-3.0.0.pre6 lib/active_fulfillment/response.rb
active_fulfillment-3.0.0.pre5 lib/active_fulfillment/response.rb
active_fulfillment-3.0.0.pre4 lib/active_fulfillment/response.rb
active_fulfillment-3.0.0.pre3 lib/active_fulfillment/response.rb
active_fulfillment-3.0.0.pre2 lib/active_fulfillment/response.rb