class Cassia::ResponseHandlers::CloseApState

Public Class Methods

new(access_controller) click to toggle source
# File lib/cassia/response_handlers/close_ap_state.rb, line 4
def initialize(access_controller)
  @access_controller = access_controller
end

Public Instance Methods

handle(response) click to toggle source
# File lib/cassia/response_handlers/close_ap_state.rb, line 8
def handle(response)
  if response.success?
    handle_success
  else
    handle_failure(response)
  end
  response.success?
end

Private Instance Methods

handle_failure(response) click to toggle source
# File lib/cassia/response_handlers/close_ap_state.rb, line 25
def handle_failure(response)
  @access_controller.error = JSON.parse(response.body)['error']
  @access_controller.error_description = JSON.parse(response.body)['error_description']
end
handle_success() click to toggle source
# File lib/cassia/response_handlers/close_ap_state.rb, line 19
def handle_success
  @access_controller.routers.each do |router|
    router.ap_state_monitor_on = false
  end
end