Sha256: 4855b5d2a6c3ddfc979a8f21742fa32ba059354a1e1042fe12c843e3cbcebcf6

Contents?: true

Size: 678 Bytes

Versions: 20

Compression:

Stored size: 678 Bytes

Contents

module Gibbon
  class MailChimpError < StandardError
    attr_reader :title, :detail, :body, :raw_body, :status_code

    def initialize(message = "", params = {})
      @title       = params[:title]
      @detail      = params[:detail]
      @body        = params[:body]
      @raw_body    = params[:raw_body]
      @status_code = params[:status_code]

      super(message)
    end

    def to_s
      super + " " + instance_variables_to_s
    end

    private

    def instance_variables_to_s
      [:title, :detail, :body, :raw_body, :status_code].map do |attr|
        attr_value = send(attr)

        "@#{attr}=#{attr_value.inspect}"
      end.join(", ")
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
gibbon-3.5.0 lib/gibbon/mailchimp_error.rb
gibbon-3.4.4 lib/gibbon/mailchimp_error.rb
gibbon-3.4.3 lib/gibbon/mailchimp_error.rb
gibbon-3.4.2 lib/gibbon/mailchimp_error.rb
gibbon-3.4.0 lib/gibbon/mailchimp_error.rb
gibbon-3.3.4 lib/gibbon/mailchimp_error.rb
gibbon-3.3.3 lib/gibbon/mailchimp_error.rb
gibbon-3.3.2 lib/gibbon/mailchimp_error.rb
gibbon-3.3.1 lib/gibbon/mailchimp_error.rb
gibbon-3.3.0 lib/gibbon/mailchimp_error.rb
gibbon-3.2.0 lib/gibbon/mailchimp_error.rb
gibbon-3.1.1 lib/gibbon/mailchimp_error.rb
gibbon-3.1.0 lib/gibbon/mailchimp_error.rb
gibbon-3.0.2 lib/gibbon/mailchimp_error.rb
gibbon-3.0.1 lib/gibbon/mailchimp_error.rb
gibbon-2.2.5 lib/gibbon/mailchimp_error.rb
gibbon-2.2.4 lib/gibbon/mailchimp_error.rb
gibbon-2.2.3 lib/gibbon/mailchimp_error.rb
gibbon-2.2.2 lib/gibbon/mailchimp_error.rb
gibbon-2.2.1 lib/gibbon/mailchimp_error.rb