Sha256: 6259ad8c40ebb0cd4fe222a62126c869bbeafdf6b52594effe50cf4d08416f18

Contents?: true

Size: 460 Bytes

Versions: 6

Compression:

Stored size: 460 Bytes

Contents

module RubyAMI
  class Error < StandardError
    attr_accessor :message, :action

    def initialize
      @headers = Hash.new
    end

    def [](key)
      @headers[key]
    end

    def []=(key,value)
      @headers[key] = value
    end

    def action_id
      @headers['ActionID']
    end

    def inspect
      "#<#{self.class} #{[:message, :headers].map { |c| "#{c}=#{self.__send__(c).inspect rescue nil}" }.compact * ', '}>"
    end
  end
end # RubyAMI

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
ruby_ami-1.2.3 lib/ruby_ami/error.rb
ruby_ami-1.2.2 lib/ruby_ami/error.rb
ruby_ami-1.2.1 lib/ruby_ami/error.rb
ruby_ami-1.2.0 lib/ruby_ami/error.rb
ruby_ami-1.1.2 lib/ruby_ami/error.rb
ruby_ami-1.1.1 lib/ruby_ami/error.rb