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?, #square

Constructor Details

#initialize(image) ⇒ Image

Returns a new instance of Image.



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

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.



97
98
99
# File 'lib/applitools/core/screenshot.rb', line 97

def image
  @image
end

Instance Method Details

#__getobj__Object



111
112
113
# File 'lib/applitools/core/screenshot.rb', line 111

def __getobj__
  @image
end

#__setobj__(obj) ⇒ Object



115
116
117
# File 'lib/applitools/core/screenshot.rb', line 115

def __setobj__(obj)
  @image = obj
end

#update!(image) ⇒ Object



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

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