class AllQ::Clear

Public Instance Methods

base_send(cache_type) click to toggle source
# File lib/allq/actions/clear.rb, line 18
def base_send(cache_type)
  {
    'action' => 'clear',
    'params' => {
      'cache_type' => cache_type
    }
  }
end
rcv(data) click to toggle source
# File lib/allq/actions/clear.rb, line 13
def rcv(data)
  return nil if data.to_s == '' || data.to_s.strip == '{}'
  JSON.parse(data)
end
snd(data) click to toggle source
# File lib/allq/actions/clear.rb, line 4
def snd(data)
  cache_type = data[:cache_type] || "all"

  send_data = base_send(cache_type)
  response = send_hash_as_json(send_data)
  result = rcv(response)
  rcv(response)
end