Class: Watirmark::Screenshot::MasterAlbum

Inherits:
Object
  • Object
show all
Defined in:
lib/watirmark/screenshot.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(filename, screenshot) ⇒ MasterAlbum

Returns a new instance of MasterAlbum.



59
60
61
62
63
64
65
66
67
68
69
# File 'lib/watirmark/screenshot.rb', line 59

def initialize(filename, screenshot)
  if Watirmark::Configuration.instance.snapshotwidth.kind_of?(Fixnum)
    @album = Master.new(filename, screenshot.screenshots)
  else
    widths = Watirmark::Configuration.instance.snapshotwidth.split(",").map {|s| s.to_i}
    @album = []
    widths.each_with_index do |width, index|
      @album << Master.new(filename.sub(/\.png/, "_width_#{width}.png"), screenshot.screenshots[index])
    end
  end
end

Instance Attribute Details

#albumObject

Returns the value of attribute album.



57
58
59
# File 'lib/watirmark/screenshot.rb', line 57

def album
  @album
end