Class: QML::ImageProvider::Request

Inherits:
Object
  • Object
show all
Defined in:
lib/qml/image_provider.rb

Overview

Request represents a image request from QML.

See Also:

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#idObject (readonly)

The image ID. If you requested “image://my_image_provider/foo/bar.png”, the ID would be “foo/bar.png”.



32
33
34
# File 'lib/qml/image_provider.rb', line 32

def id
  @id
end

Instance Method Details

#finish(data) ⇒ Object

Finishes the image request.

Parameters:

  • data (String)

    The image file data



36
37
38
39
40
41
# File 'lib/qml/image_provider.rb', line 36

def finish(data)
  fail ::TypeError, "data must be a String" unless data.is_a? ::String
  QML.later do
    @promise.set_data(data)
  end
end