Sha256: 257d6cb94119d4899e18c904845f9ad9da924be5fba10425cba8b3988370aa47
Contents?: true
Size: 665 Bytes
Versions: 3
Compression:
Stored size: 665 Bytes
Contents
module Percy class Client module Snapshots def create_snapshot(build_id, resources, options = {}) raise ArgumentError.new('resources must be an iterable') if !resources.respond_to?(:each) name = options[:name] data = { 'data' => { 'type' => 'snapshots', 'attributes' => { 'name' => name, }, 'relationships' => { 'resources' => { 'data' => resources.map { |r| r.serialize }, }, }, }, } post("#{config.api_url}/builds/#{build_id}/snapshots/", data) end end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
percy-client-0.2.2 | lib/percy/client/snapshots.rb |
percy-client-0.2.1 | lib/percy/client/snapshots.rb |
percy-client-0.2.0 | lib/percy/client/snapshots.rb |