Sha256: dfc40093f12c6605c0a1563fc1f952a45d214e4195b753e2d85f22c3e4002fcb
Contents?: true
Size: 467 Bytes
Versions: 29
Compression:
Stored size: 467 Bytes
Contents
module Siteleaf class Job < Entity attr_reader :id def stream(&callback) HTTParty.send(:get, Siteleaf.api_url("jobs/#{self.id}"), { :basic_auth => {:username => Siteleaf.api_key, :password => Siteleaf.api_secret}, :stream_body => true }) do |fragment| if str = fragment.match(/{.*}/) if json = JSON.parse(str[0]) callback.call(json) end end end end end end
Version data entries
29 entries across 29 versions & 1 rubygems