Caplin Trader 4.7.1

Global

Members

sinon

Sinon.JS 1.10.3, 2014/07/11
Author:
  • Christian Johansen (christian@cjohansen.no)
  • Contributors: https://github.com/cjohansen/Sinon.JS/blob/master/AUTHORS (The BSD License) Copyright (c) 2010-2014, Christian Johansen, christian@cjohansen.no All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of Christian Johansen nor the names of his contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Source:

Methods

AllowedProductsPermissionQuery(user, product, namespace, name, type, listener)

Parameters:
Name Type Description
user string User name
product string Product to query permissions for
namespace string Namespace of product to query permissions for
name string Name to query permissions for
type string Type to query permissions for
listener PermissionServiceListener Listener that is notified on permission changes

deprecated(className, methodName, sDate, message)

Invoked by API methods that have been deprecated. If the unary parameter deprecated is included within the query string of the application web page any invocations of this method will result in an error message being displayed, making it easier to find out which deprecated methods are being used by the application. Remember that we want to be able to pull uses of this method, including the classname, the method name and the date out of our code base using a regex.
Parameters:
Name Type Description
className String The name of the class that has been deprecated (or the class that the deprecated method belongs to.
methodName String | null The name of the method that is deprecated. null if the whole class or constructor has been deprecated.
sDate String The date that this method was deprecated in YYYY-MM-DD format, e.g. "2012-03-20"
message String A message describing the deprecation. This should explain how code that uses this method should be rewritten.

elementHasClass()

Checks if a given element has the provided class

extend(vSubClass, vSuperClass)

Extends the class definition of the sub class with the class definition of the super class.

Subclassing in JavaScript is done by extending the prototype of the sub class with the properties that are defined on the prototype of the super class.

The properties on the super class can be any type of JavaScript object, including a standard function object, typically used as a class method, or simply an object, typically used a static member.

Parameters:
Name Type Description
vSubClass Variant The class that is extending the superclass. This can be either a reference to the class's constructor or a String representation
vSuperClass Variant The class to be extended. This can be either a reference to the class's constructor or a String representation

getClass(fullClassName, vLoadClassopt) → {function}

Returns the constructor function for a class given the fully qualified class name in string form.

This method does not actually load the class unless the bLoadClass argument is true, in which case the class is loaded synchronously
Behaviour for when the class is unknown can be defined; context: name of what needs the class, unknownClass: function returned instead. load: Boolean determining whether to attempt loading the class. singleton: Raise/throw error if the class isn't a singleton. If no unknownClass is specified an exception will be thrown, otherwise an error will be raised.

caplin.getClass('myapp.SomeClass') - Fetch a loaded class, which isn't a singleton, throw Error if not known.
caplin.getClass('myapp.SomeClass',{unknownClass:myapp.Fallback,context:'myapp'}) - Fetch loaded class, use myapp.Fallback if not known, and raise error in log.
(see caplin#include).
Parameters:
Name Type Attributes Default Description
fullClassName String The full name of the class.
vLoadClass boolean | object <optional>
false true if this method should ensure that the specified class is loaded, otherwise false. If a Map is passed details about handling of unknown class must be specified.
Throws:
Error if the specified class name is not a String.
Returns:
The constructor for the specified class.
Type
function

getPackage(packageName) → {Object}

Returns the inner-most package object for the given package name string.
Parameters:
Name Type Description
packageName String
Returns:
the inner most package
Type
Object

implement(fClass, fInterface)

Extends the class definition of fClass with the interface defined in fInterface.
Parameters:
Name Type Description
fClass function The class that is implementing the interface.
fInterface function The interface that the class must implement.

isImplementorOf(oInstance, fClass) → {boolean}

Checks that an object instance implements all the public functions of the class (i.e. a duck-typing check). NB: does not check the entire prototype chain.
Parameters:
Name Type Description
oInstance Object An object instance that we are checking.
fClass function The class or interface we are checking against.
Throws:
Error if fClass is not a function.
Returns:
true if the instance is an instance of the class constructed by the function.
Type
boolean

module:caplin/sljsadapter/watchlist/StreamLinkWatchlistRequestManager(streamlink)

Parameters:
Name Type Description
streamlink module:sljs/StreamLink The streamlink service.

unsupported(className, methodNameopt)

Invoked by API methods that are no longer supported.
Parameters:
Name Type Attributes Description
className String The name of the class that is no longer supported or the class that the unsupported method belongs to.
methodName String <optional>
The name of the method that is no longer supported (not needed for constructors).

Type Definitions

ContainerField

An object describing a container field.
Type:
  • Object
Properties:
Name Type Attributes Description
fieldName String The name of the field in the container. Or a "fake" name if this is a computed field.
computed function <optional>
A function that sets the value of the computed field. It will be called whenever a record is updated. It will recieve two arguments: a presenter property to which it will write the value, and an object with all the fields and values for that record.
formatter Object <optional>
An object configuring a formatter to be used on this property.
Properties
Name Type Attributes Description
instance Class <optional>
The formatter instance.
config Object <optional>
A config object for the formatter.