Namespace rio.Utils
Random utility methods
Defined in: utils.js.
Constructor Attributes | Constructor Name and Description |
---|---|
Method Attributes | Method Name and Description |
---|---|
<static> |
rio.Utils.baseUrl()
|
<static> |
rio.Utils.browserFromUserAgent(agt)
|
<static> |
rio.Utils.cycle(var1, var2)
Alternates returning the two input arguments.
|
<static> |
rio.Utils.navigateTo(location, action, token)
Navigates to a given URL, allowing you to set the Rails-style HTTP method.
|
<static> |
rio.Utils.osFromUserAgent(agt)
|
<static> |
rio.Utils.pluralize(num, singular, plural)
Returns the singular argument if num == 1, otherwise returns the plural argument.
|
<static> |
rio.Utils.urlWithoutHash()
|
Method Detail
<static>
rio.Utils.baseUrl()
<static>
rio.Utils.browserFromUserAgent(agt)
- Parameters:
- agt
<static>
rio.Utils.cycle(var1, var2)
Alternates returning the two input arguments.
- Parameters:
- var1
- var2
<static>
rio.Utils.navigateTo(location, action, token)
Navigates to a given URL, allowing you to set the Rails-style HTTP method.
- Parameters:
- {String} location
- The url to goto
- {String} action
- (optional) The HTTP verb to use. (currently supports get|delete)
- {String} token
- (optional) A Rails-style authenticity token
<static>
rio.Utils.osFromUserAgent(agt)
- Parameters:
- agt
<static>
rio.Utils.pluralize(num, singular, plural)
Returns the singular argument if num == 1, otherwise returns the plural argument.
- Parameters:
- {Number} num
- The number to be evaluated for plurality
- {Object} singular
- The return value if num == 1
- {Object} plural
- The return value if num != 1
<static>
rio.Utils.urlWithoutHash()