Method: AllQ::Get#rcv

Defined in:
lib/allq/actions/get.rb

#rcv(data) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
# File 'lib/allq/actions/get.rb', line 10

def rcv(data)
  return nil if data.to_s == '' || data.to_s.strip == '{}'

  result = JSON.parse(data)
  if result['job']
    return nil if result['job'].empty?
    job = Job.new_from_hash(result['job'], @client)
    return job
  end
  nil
end