lib/visdiff/revision.rb in visdiff-0.0.3 vs lib/visdiff/revision.rb in visdiff-0.0.4
- old
+ new
@@ -1,24 +1,27 @@
module Visdiff
class Revision
- attr_reader :identifier, :images, :description
+ attr_reader :identifier, :images, :description, :url, :id
attr_accessor :client
def initialize identifier, images=[], description=nil
@identifier = identifier
@images = images
@description = description
+ @url = @id = nil
end
def add_image identifier, filename
image = Image.new(identifier, filename)
image.client = client
@images << image
end
def submit!
response = client.submit_revision(self)
+ @id = response['id']
+ @url = response['url']
missing_images = []
response['images'].each do |rimg|
missing_images << rimg['signature'] unless rimg['url']
end
@@ -26,9 +29,11 @@
images.each do |image|
next unless missing_images.include?(image.signature)
client.submit_image(image)
end
+
+ puts @url
end
def attributes
{
identifier: identifier,