class ChupaText::Screenshot
Attributes
@return [String] The data of the screenshot.
@return [String, nil] The encoding of the screenshot data.
`nil` means that the data is raw data. It's used for SVG data because it's text data. `"base64"` means that the data is encoded by Base64. It's used for PNG data because it's binary data.
@return [String] The MIME type of the screenshot.
Public Class Methods
Source
# File lib/chupa-text/screenshot.rb, line 31 def initialize(mime_type, data, encoding=nil) @mime_type = mime_type @data = data @encoding = encoding end
Public Instance Methods
Source
# File lib/chupa-text/screenshot.rb, line 37 def decoded_data case @encoding when "base64" @data.unpack("m*")[0] else @data end end