class SemaphoreClient::Exceptions::ResponseError

Attributes

env[R]

Public Class Methods

new(env) click to toggle source
Calls superclass method
# File lib/semaphore_client/exceptions.rb, line 12
def initialize(env)
  @env = env

  super(message)
end

Public Instance Methods

body() click to toggle source
# File lib/semaphore_client/exceptions.rb, line 26
def body
  JSON.parse(@env[:body])
end
code() click to toggle source
# File lib/semaphore_client/exceptions.rb, line 18
def code
  @env[:status]
end
message() click to toggle source
# File lib/semaphore_client/exceptions.rb, line 22
def message
  body["message"] if body.is_a?(Hash)
end