Exception: Jimson::ServerError::Generic

Inherits:
Exception
  • Object
show all
Defined in:
lib/jimson/server_error.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(code, message) ⇒ Generic

Returns a new instance of Generic.



6
7
8
9
10
# File 'lib/jimson/server_error.rb', line 6

def initialize(code, message)
  @code = code
  @message = message
  super(message)
end

Instance Attribute Details

#codeObject

Returns the value of attribute code.



4
5
6
# File 'lib/jimson/server_error.rb', line 4

def code
  @code
end

#messageObject

Returns the value of attribute message.



4
5
6
# File 'lib/jimson/server_error.rb', line 4

def message
  @message
end

Instance Method Details

#to_hObject



12
13
14
15
16
17
# File 'lib/jimson/server_error.rb', line 12

def to_h
  {
    'code'    => @code,
    'message' => @message
  }
end