Sha256: b67116a38f68c51a5c8c27f987330779ab32d54599b19263c100f44629d2349f

Contents?: true

Size: 712 Bytes

Versions: 17

Compression:

Stored size: 712 Bytes

Contents

class Blitline
  class Job
    include AttributeJsonizer
    attr_accessor :application_id, :src, :postback_url, :functions

    def initialize(image_src, application_id = nil)
      @src = image_src
      @functions = []
    end

    def add_function(function_name, function_params, image_identifier = nil)
      function = Blitline::Function.new(function_name, function_params)
      function.add_save(image_identifier) if image_identifier
      @functions << function
      return function
    end

    def validate
      raise "Job must have an application_id" if @application_id.nil?
      raise "Job must have an image_src to work on" if @src.nil?
      @functions.each { |f| f.validate }
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
blitline-2.9.0 lib/blitline/job.rb
blitline-2.8.0 lib/blitline/job.rb
blitline-2.7.0 lib/blitline/job.rb
blitline-2.6.0 lib/blitline/job.rb
blitline-2.5.1 lib/blitline/job.rb
blitline-2.5.0 lib/blitline/job.rb
blitline-2.4.0 lib/blitline/job.rb
blitline-2.3.0 lib/blitline/job.rb
blitline-2.2.0 lib/blitline/job.rb
blitline-2.1.0 lib/blitline/job.rb
blitline-2.0.1 lib/blitline/job.rb
blitline-1.4.0 lib/blitline/job.rb
blitline-1.3.0 lib/blitline/job.rb
blitline-1.2.3 lib/blitline/job.rb
blitline-1.2.2 lib/blitline/job.rb
blitline-1.2.0 lib/blitline/job.rb
blitline-1.1.0 lib/blitline/job.rb