Sha256: dd566e56612bf66e5da73e25ef8c79ecbd8c54f8d86b6ca6945f4c32e756857e

Contents?: true

Size: 900 Bytes

Versions: 58

Compression:

Stored size: 900 Bytes

Contents

module Datahen
  module Client
    class ScraperJobVar < Datahen::Client::Base

      def find(scraper_name, var_name)
        self.class.get("/scrapers/#{scraper_name}/current_job/vars/#{var_name}", @options)
      end

      def all(scraper_name, opts={})
        params = @options.merge opts
        self.class.get("/scrapers/#{scraper_name}/current_job/vars", params)
      end

      def set(scraper_name, var_name, value, opts={})
        body = {}
        body[:value] = value
        body[:secret] = opts[:secret] if opts[:secret]
        params = @options.merge({body: body.to_json})
        self.class.put("/scrapers/#{scraper_name}/current_job/vars/#{var_name}", params)
      end

      def unset(scraper_name, var_name, opts={})
        params = @options.merge(opts)
        self.class.delete("/scrapers/#{scraper_name}/current_job/vars/#{var_name}", params)
      end
    end
  end
end

Version data entries

58 entries across 58 versions & 1 rubygems

Version Path
datahen-1.6.3 lib/datahen/client/scraper_job_var.rb
datahen-1.6.2 lib/datahen/client/scraper_job_var.rb
datahen-1.6.1 lib/datahen/client/scraper_job_var.rb
datahen-1.6.0 lib/datahen/client/scraper_job_var.rb
datahen-1.5.3 lib/datahen/client/scraper_job_var.rb
datahen-1.5.2 lib/datahen/client/scraper_job_var.rb
datahen-1.5.1 lib/datahen/client/scraper_job_var.rb
datahen-1.4.0 lib/datahen/client/scraper_job_var.rb
datahen-1.3.2 lib/datahen/client/scraper_job_var.rb
datahen-1.3.1 lib/datahen/client/scraper_job_var.rb
datahen-1.3.0 lib/datahen/client/scraper_job_var.rb
datahen-1.2.3 lib/datahen/client/scraper_job_var.rb
datahen-1.2.2 lib/datahen/client/scraper_job_var.rb
datahen-1.2.1 lib/datahen/client/scraper_job_var.rb
datahen-1.1.2 lib/datahen/client/scraper_job_var.rb
datahen-1.1.1 lib/datahen/client/scraper_job_var.rb
datahen-1.0.3 lib/datahen/client/scraper_job_var.rb
datahen-1.0.2 lib/datahen/client/scraper_job_var.rb
datahen-1.0.1 lib/datahen/client/scraper_job_var.rb
datahen-1.0.0 lib/datahen/client/scraper_job_var.rb