Sha256: e335d252e82ba977f00a2d335e97a93f956c995ffb380fcd3c7bf9f849bc6707

Contents?: true

Size: 584 Bytes

Versions: 9

Compression:

Stored size: 584 Bytes

Contents

module SauceWhisk
  class Assets
    extend RestRequestBuilder

    def self.resource
      "#{SauceWhisk.username}/jobs"
    end

    def self.fetch(job_id, asset, type=nil)
      data = get "#{job_id}/assets/#{asset}"
      Asset.new({:name => asset, :data => data, :job_id => job_id, :type => type})
    end
  end

  class Asset

    attr_reader :asset_type, :name, :data, :job

    def initialize(parameters={})
      @asset_type = parameters[:type] || :screenshot
      @name = parameters[:name]
      @data = parameters[:data]
      @job = parameters[:job_id]
    end

  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
sauce_whisk-0.0.11 lib/sauce_whisk/assets.rb
sauce_whisk-0.0.10 lib/sauce_whisk/assets.rb
sauce_whisk-0.0.9 lib/sauce_whisk/assets.rb
sauce_whisk-0.0.8 lib/sauce_whisk/assets.rb
sauce_whisk-0.0.7 lib/sauce_whisk/assets.rb
sauce_whisk-0.0.5 lib/sauce_whisk/assets.rb
sauce_whisk-0.0.4 lib/sauce_whisk/assets.rb
sauce_whisk-0.0.3 lib/sauce_whisk/assets.rb
sauce_whisk-0.0.2 lib/sauce_whisk/assets.rb