Class: AssetHandler
Class Method Summary collapse
Instance Method Summary collapse
- #done(&block) ⇒ Object
-
#initialize(url) ⇒ AssetHandler
constructor
A new instance of AssetHandler.
- #start ⇒ Object
Constructor Details
#initialize(url) ⇒ AssetHandler
Returns a new instance of AssetHandler.
25 26 27 |
# File 'lib/droiuby/support/asset.rb', line 25 def initialize(url) @url = url end |
Class Method Details
.download(url) ⇒ Object
29 30 31 |
# File 'lib/droiuby/support/asset.rb', line 29 def self.download(url) AssetHandler.new(url) end |
Instance Method Details
#done(&block) ⇒ Object
43 44 45 46 |
# File 'lib/droiuby/support/asset.rb', line 43 def done(&block) @block = block self end |
#start ⇒ Object
33 34 35 36 37 38 39 40 41 |
# File 'lib/droiuby/support/asset.rb', line 33 def start async.perform { result = BitmapDrawableWrapper.new(Java::com.droiuby.client.core.utils.Utils.loadAppAssetRuby(_execution_bundle, _current_app, _current_activity, @url, Java::com.droiuby.client.core.utils.Utils::ASSET_TYPE_IMAGE, Java::com.droiuby.client.core.utils.Utils::HTTP_GET)) result }.done { |result| @block.call(result) }.start end |