class MoesifApi::BaseController
Attributes
http_call_back[RW]
http_client[RW]
Public Class Methods
new(http_client: nil, http_call_back: nil)
click to toggle source
# File lib/moesif_api/controllers/base_controller.rb, line 9 def initialize(http_client: nil, http_call_back: nil) @http_client = http_client ||= @@http_client @http_call_back = http_call_back end
Public Instance Methods
validate_response(context)
click to toggle source
# File lib/moesif_api/controllers/base_controller.rb, line 14 def validate_response(context) if !context.response.status_code.between?(200, 208) #[200,208] = HTTP OK raise APIException.new 'HTTP Response Not OK', context end end