Class: QML::ImageProvider::Request
- Inherits:
-
Object
- Object
- QML::ImageProvider::Request
- Defined in:
- lib/qml/image_provider.rb
Overview
Request represents a image request from QML.
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
The image ID.
Instance Method Summary collapse
-
#finish(data) ⇒ Object
Finishes the image request.
Instance Attribute Details
#id ⇒ Object (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.
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 |