Class: Applitools::Screenshot::Datastream
Instance Attribute Summary collapse
Instance Method Summary
collapse
from_any_image, from_datastream, from_image, from_region, #method_missing, #respond_to_missing?, #square
Constructor Details
#initialize(image) ⇒ Datastream
Returns a new instance of Datastream.
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
in the class Applitools::Screenshot
Instance Attribute Details
#datastream ⇒ Object
Returns the value of attribute datastream.
54
55
56
|
# File 'lib/applitools/core/screenshot.rb', line 54
def datastream
@datastream
end
|
Instance Method Details
#__getobj__ ⇒ Object
Also known as:
image
81
82
83
|
# File 'lib/applitools/core/screenshot.rb', line 81
def __getobj__
restore
end
|
#__setobj__(obj) ⇒ Object
87
88
89
90
|
# File 'lib/applitools/core/screenshot.rb', line 87
def __setobj__(obj)
@datastream = obj.to_datastream
self
end
|
77
78
79
|
# File 'lib/applitools/core/screenshot.rb', line 77
def
@datastream.
end
|
#restore ⇒ Object
92
93
94
|
# File 'lib/applitools/core/screenshot.rb', line 92
def restore
end
|
#sha256 ⇒ Object
96
97
98
|
# File 'lib/applitools/core/screenshot.rb', line 96
def sha256
Digest::SHA2.new(256).hexdigest(@datastream.to_s)
end
|
#to_blob ⇒ Object
73
74
75
|
# File 'lib/applitools/core/screenshot.rb', line 73
def to_blob
@datastream.to_blob
end
|
#update!(image) ⇒ Object
66
67
68
69
70
71
|
# File 'lib/applitools/core/screenshot.rb', line 66
def update!(image)
Applitools::ArgumentGuard.not_nil(image, 'image')
@datastream = image.to_datastream
self
end
|