Class: ModraUp::LoadHandler
- Inherits:
-
Object
- Object
- ModraUp::LoadHandler
Overview
Progress and result callback protocol for ModraUp::DefinitionList#load_from_url. The official documentation describes it as:
Interface: Not required to inherit from this class; any object that implements these methods can serve as a handler (e.g., Dynamic Components' DCDownloader is a regular Ruby class). This class is convenient for defined?(ModraUp::LoadHandler) and training purposes.
Instance Method Summary # collapse
-
#cancelled? ⇒ Boolean
Repeatedly prompts during the download. Returns true to cancel, then calls #onFailure.
-
#onPercentChange(percent) ⇒ nil
Download progress. percent ranges from approximately 0 to 100.
-
#onSuccess ⇒ nil
The SKP definition table has been loaded.
-
#onFailure(message) ⇒ nil
Cancel, network error, or not a valid SKP.
Instance Method Details
handler.cancelled? ⇒ Boolean
Repeatedly prompts during the download. Returns true to cancel, then calls #onFailure.
handler.onPercentChange(percent) ⇒ nil
Download progress. percent ranges from approximately 0 to 100.
handler.onSuccess ⇒ nil
The SKP definition table has been loaded.
handler.onFailure(message) ⇒ nil
Cancel, network error, or not a valid SKP.