Sha256: e8bb905c2ea16f3aa2c8907847af645eab0ed1d7c3eb0a425b639f88490ec0d9

Contents?: true

Size: 479 Bytes

Versions: 8

Compression:

Stored size: 479 Bytes

Contents

# encoding: utf-8
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

8 entries across 8 versions & 1 rubygems

Version Path
ruby_ami-1.3.4 lib/ruby_ami/error.rb
ruby_ami-1.3.3 lib/ruby_ami/error.rb
ruby_ami-1.3.2 lib/ruby_ami/error.rb
ruby_ami-1.3.1 lib/ruby_ami/error.rb
ruby_ami-1.3.0 lib/ruby_ami/error.rb
ruby_ami-1.2.6 lib/ruby_ami/error.rb
ruby_ami-1.2.5 lib/ruby_ami/error.rb
ruby_ami-1.2.4 lib/ruby_ami/error.rb