Sha256: f5ce72aa392baad9c4021ec764101158071f43396619624d15a963a4f0f50f26

Contents?: true

Size: 580 Bytes

Versions: 6

Compression:

Stored size: 580 Bytes

Contents

const AbstractHandler = require("./AbstractHandler");

class InvokeGlobalMethodHandler extends AbstractHandler {
    constructor() {
        super()
    }

    process(command) {
        const { payload } = command
        const splitted = payload[0].split(".")
        const args = payload.slice(1)
        let methodToInvoke

        for(let i = 0; i < splitted.length; i++) {
            methodToInvoke = !methodToInvoke ? global[splitted[i]] : methodToInvoke[splitted[i]]
        }
        return methodToInvoke(args)
    }

}

module.exports = new InvokeGlobalMethodHandler()

Version data entries

6 entries across 3 versions & 1 rubygems

Version Path
javonet-ruby-sdk-2.0.4 lib/javonet-ruby-sdk/Binaries/Nodejs/Linux/X64/core/handler/InvokeGlobalMethodHandler.js
javonet-ruby-sdk-2.0.4 lib/javonet-ruby-sdk/Binaries/Nodejs/MacOs/X64/core/handler/InvokeGlobalMethodHandler.js
javonet-ruby-sdk-2.0.1 lib/javonet-ruby-sdk/Binaries/Nodejs/Linux/X64/src/core/handler/InvokeGlobalMethodHandler.js
javonet-ruby-sdk-2.0.1 lib/javonet-ruby-sdk/Binaries/Nodejs/MacOs/X64/src/core/handler/InvokeGlobalMethodHandler.js
javonet-ruby-sdk-2.0.0 lib/javonet-ruby-sdk/Binaries/Nodejs/Linux/X64/src/core/handler/InvokeGlobalMethodHandler.js
javonet-ruby-sdk-2.0.0 lib/javonet-ruby-sdk/Binaries/Nodejs/MacOs/X64/src/core/handler/InvokeGlobalMethodHandler.js