Sha256: 58ab0f6f67038bbeef0f9348bb685b69fc87c15183942d9cb6b1cda280d06284

Contents?: true

Size: 1.46 KB

Versions: 9

Compression:

Stored size: 1.46 KB

Contents

package org.ruboto;

public class ScriptInfo {
    private String rubyClassName;
    private String scriptName;
    private Object rubyInstance;

    public boolean isReadyToLoad() {
      return rubyClassName != null || scriptName != null;
    }

    public boolean isLoaded() {
      return rubyInstance != null;
    }

    public void setFromIntent(android.content.Intent intent) {
      android.os.Bundle configBundle = intent.getBundleExtra("Ruboto Config");

      if (configBundle != null) {
        if (configBundle.containsKey("ClassName")) {
          setRubyClassName(configBundle.getString("ClassName"));
        }
        if (configBundle.containsKey("Script")) {
          setScriptName(configBundle.getString("Script"));
        }
      }
    }

    public String getRubyClassName() {
        if (rubyClassName == null && scriptName != null) {
            return Script.toCamelCase(scriptName);
         }
        return rubyClassName;
    }

    public void setRubyClassName(String name) {
        rubyClassName = name;
    }

    public Object getRubyInstance() {
        return rubyInstance;
    }

    public void setRubyInstance(Object instance) {
        rubyInstance = instance;
    }

    public String getScriptName() {
        if (scriptName == null && rubyClassName != null) {
            return Script.toSnakeCase(rubyClassName) + ".rb";
        }
        return scriptName;
    }

    public void setScriptName(String name) {
        scriptName = name;
    }

}

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
ruboto-0.12.0 assets/src/org/ruboto/ScriptInfo.java
ruboto-0.13.0.rc.0 assets/src/org/ruboto/ScriptInfo.java
ruboto-0.12.0.rc.0 assets/src/org/ruboto/ScriptInfo.java
ruboto-0.11.0 assets/src/org/ruboto/ScriptInfo.java
ruboto-0.11.0.rc.1 assets/src/org/ruboto/ScriptInfo.java
ruboto-0.11.0.rc.0 assets/src/org/ruboto/ScriptInfo.java
ruboto-0.10.2 assets/src/org/ruboto/ScriptInfo.java
ruboto-0.10.2.rc.0 assets/src/org/ruboto/ScriptInfo.java
ruboto-0.10.1 assets/src/org/ruboto/ScriptInfo.java