Exception: RubyAMI::Error

Inherits:
StandardError
  • Object
show all
Defined in:
lib/ruby_ami/error.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeError

Returns a new instance of Error.



5
6
7
# File 'lib/ruby_ami/error.rb', line 5

def initialize
  @headers = HashWithIndifferentAccess.new
end

Instance Attribute Details

#actionObject

Returns the value of attribute action.



3
4
5
# File 'lib/ruby_ami/error.rb', line 3

def action
  @action
end

#messageObject

Returns the value of attribute message.



3
4
5
# File 'lib/ruby_ami/error.rb', line 3

def message
  @message
end

Instance Method Details

#[](key) ⇒ Object



9
10
11
# File 'lib/ruby_ami/error.rb', line 9

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

#[]=(key, value) ⇒ Object



13
14
15
# File 'lib/ruby_ami/error.rb', line 13

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

#action_idObject



17
18
19
# File 'lib/ruby_ami/error.rb', line 17

def action_id
  @headers['ActionID']
end

#inspectObject



21
22
23
# File 'lib/ruby_ami/error.rb', line 21

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