Warning Older Docs! - You are viewing documentation for a previous released version of RhoMobile Suite.

Config

Properties1

Rho.Config module

Implementation of the Config API.

Methods

getPropertyBool
(STRING name)

Get boolean value of config property.

Parameters

  • name : STRING

    Name of the property.

Synchronous Return:

  • BOOLEAN

Method Access:

  • Class Method: This method can only be accessed via the API class object.
    • JavaScript: Rho.Config.getPropertyBool(STRING name)
    • Ruby: Rho::Config.getPropertyBool(STRING name)
getPropertyInt
(STRING name)

Get integer value of config property.

Parameters

  • name : STRING

    Name of the property.

Synchronous Return:

  • INTEGER

Method Access:

  • Class Method: This method can only be accessed via the API class object.
    • JavaScript: Rho.Config.getPropertyInt(STRING name)
    • Ruby: Rho::Config.getPropertyInt(STRING name)
getPropertyString
(STRING name)

Get string value of config property.

Parameters

  • name : STRING

    Name of the property.

Synchronous Return:

  • STRING

Method Access:

  • Class Method: This method can only be accessed via the API class object.
    • JavaScript: Rho.Config.getPropertyString(STRING name)
    • Ruby: Rho::Config.getPropertyString(STRING name)
isPropertyExists
(STRING name)

Returns true if property exists in the loaded config file.

Parameters

  • name : STRING

    Name of the property.

Synchronous Return:

  • BOOLEAN

Method Access:

  • Class Method: This method can only be accessed via the API class object.
    • JavaScript: Rho.Config.isPropertyExists(STRING name)
    • Ruby: Rho::Config.isPropertyExists(STRING name)
loadFromFile
()

Load config from the file specified by configPath property.

Synchronous Return:

  • Void

Method Access:

  • Class Method: This method can only be accessed via the API class object.
    • JavaScript: Rho.Config.loadFromFile()
    • Ruby: Rho::Config.loadFromFile()
removeProperty
(STRING name, BOOLEAN saveToFile)

Remove existing property and optionally save changes to file. Remove properties works only with properties that has been set with setProperty*** methods. Properties from config file doesn’t changed.

Parameters

  • name : STRING

    Name of the property.

  • saveToFile : BOOLEAN

    If true, save changes to file. All changes will save in separate file, not in common config of a aplication.

Synchronous Return:

  • Void

Method Access:

  • Class Method: This method can only be accessed via the API class object.
    • JavaScript: Rho.Config.removeProperty(STRING name, BOOLEAN saveToFile)
    • Ruby: Rho::Config.removeProperty(STRING name, BOOLEAN saveToFile)
setPropertyBool
(STRING name, BOOLEAN value, BOOLEAN saveToFile)

Set boolean value of config property and optionally save changes to file. Properties save to separate file, common file (specify with configPath) doesn’t change.

Parameters

  • name : STRING

    Name of the property.

  • value : BOOLEAN

    Value of the property.

  • saveToFile : BOOLEAN

    If true, save changes to file. All changes will save in separate file, not in common config of a aplication.

Synchronous Return:

  • Void

Method Access:

  • Class Method: This method can only be accessed via the API class object.
    • JavaScript: Rho.Config.setPropertyBool(STRING name, BOOLEAN value, BOOLEAN saveToFile)
    • Ruby: Rho::Config.setPropertyBool(STRING name, BOOLEAN value, BOOLEAN saveToFile)
setPropertyInt
(STRING name, INTEGER value, BOOLEAN saveToFile)

Set integer value of config property and optionally save changes to file. Properties save to separate file, common file (specify with configPath) doesn’t change.

Parameters

  • name : STRING

    Name of the property.

  • value : INTEGER

    Value of the property.

  • saveToFile : BOOLEAN

    If true, save changes to file. All changes will save in separate file, not in common config of a aplication.

Synchronous Return:

  • Void

Method Access:

  • Class Method: This method can only be accessed via the API class object.
    • JavaScript: Rho.Config.setPropertyInt(STRING name, INTEGER value, BOOLEAN saveToFile)
    • Ruby: Rho::Config.setPropertyInt(STRING name, INTEGER value, BOOLEAN saveToFile)
setPropertyString
(STRING name, STRING value, BOOLEAN saveToFile)

Set string value of config property and optionally save changes to file. Properties save to separate file, common file (specify with configPath) doesn’t change.

Parameters

  • name : STRING

    Name of the property.

  • value : STRING

    Value of the property.

  • saveToFile : BOOLEAN

    If true, save changes to file. All changes will save in separate file, not in common config of a aplication.

Synchronous Return:

  • Void

Method Access:

  • Class Method: This method can only be accessed via the API class object.
    • JavaScript: Rho.Config.setPropertyString(STRING name, STRING value, BOOLEAN saveToFile)
    • Ruby: Rho::Config.setPropertyString(STRING name, STRING value, BOOLEAN saveToFile)

Properties

configPath
: STRING

Path to the config file.

Property Access:

  • Instance: This property can be accessed via an instance object of this class:
    • myObject.configPath