Class: Applitools::Screenshot::Image

Inherits:
Applitools::Screenshot show all
Defined in:
lib/applitools/core/screenshot.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Applitools::Screenshot

from_any_image, from_datastream, from_image, from_region, #method_missing, #respond_to_missing?

Constructor Details

#initialize(image) ⇒ Image

Returns a new instance of Image.



93
94
95
96
97
# File 'lib/applitools/core/screenshot.rb', line 93

def initialize(image)
  Applitools::ArgumentGuard.not_nil(image, 'image')
  Applitools::ArgumentGuard.is_a?(image, 'image', ::ChunkyPNG::Image)
  @image = image
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Applitools::Screenshot

Instance Attribute Details

#imageObject (readonly)

Returns the value of attribute image.



91
92
93
# File 'lib/applitools/core/screenshot.rb', line 91

def image
  @image
end

Instance Method Details

#__getobj__Object



105
106
107
# File 'lib/applitools/core/screenshot.rb', line 105

def __getobj__
  @image
end

#__setobj__(obj) ⇒ Object



109
110
111
# File 'lib/applitools/core/screenshot.rb', line 109

def __setobj__(obj)
  @image = obj
end

#update!(image) ⇒ Object



99
100
101
102
103
# File 'lib/applitools/core/screenshot.rb', line 99

def update!(image)
  Applitools::ArgumentGuard.not_nil(image, 'image')
  Applitools::ArgumentGuard.is_a?(image, 'image', ::ChunkyPNG::Image)
  @image = image
end