Class: Quark::MdkRuntime::Promise::CallIfIsInstance

Inherits:
DatawireQuarkCore::QuarkObject show all
Extended by:
DatawireQuarkCore::Static
Defined in:
lib/mdk_runtime/promise.rb

Constant Summary

Constants included from DatawireQuarkCore::Static

DatawireQuarkCore::Static::Unassigned

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from DatawireQuarkCore::Static

_lazy_statics, static, unlazy_statics

Methods inherited from DatawireQuarkCore::QuarkObject

#to_s

Constructor Details

#initialize(underlying, klass) ⇒ CallIfIsInstance

Returns a new instance of CallIfIsInstance.



318
319
320
321
322
323
324
325
# File 'lib/mdk_runtime/promise.rb', line 318

def initialize(underlying, klass)
    
    self.__init_fields__
    (self)._underlying = underlying
    (self)._class = klass

    nil
end

Instance Attribute Details

#_classObject

Returns the value of attribute _class.



311
312
313
# File 'lib/mdk_runtime/promise.rb', line 311

def _class
  @_class
end

#_underlyingObject

Returns the value of attribute _underlying.



311
312
313
# File 'lib/mdk_runtime/promise.rb', line 311

def _underlying
  @_underlying
end

Instance Method Details

#__init_fields__Object



373
374
375
376
377
378
379
# File 'lib/mdk_runtime/promise.rb', line 373

def __init_fields__()
    
    self._underlying = nil
    self._class = nil

    nil
end

#_getClassObject



341
342
343
344
345
346
# File 'lib/mdk_runtime/promise.rb', line 341

def _getClass()
    
    return "mdk_runtime.promise._CallIfIsInstance"

    nil
end

#_getField(name) ⇒ Object



348
349
350
351
352
353
354
355
356
357
358
359
# File 'lib/mdk_runtime/promise.rb', line 348

def _getField(name)
    
    if ((name) == ("_underlying"))
        return (self)._underlying
    end
    if ((name) == ("_class"))
        return (self)._class
    end
    return nil

    nil
end

#_setField(name, value) ⇒ Object



361
362
363
364
365
366
367
368
369
370
371
# File 'lib/mdk_runtime/promise.rb', line 361

def _setField(name, value)
    
    if ((name) == ("_underlying"))
        (self)._underlying = ::DatawireQuarkCore.cast(value) { ::Quark.quark.UnaryCallable }
    end
    if ((name) == ("_class"))
        (self)._class = ::DatawireQuarkCore.cast(value) { ::Quark.quark.reflect.QuarkClass }
    end

    nil
end

#call(arg) ⇒ Object



330
331
332
333
334
335
336
337
338
339
# File 'lib/mdk_runtime/promise.rb', line 330

def call(arg)
    
    if ((self)._class.hasInstance(arg))
        return ((self)._underlying).call(arg)
    else
        return arg
    end

    nil
end