Class: Quark::Quark::CallIfIsInstance

Inherits:
DatawireQuarkCore::QuarkObject show all
Extended by:
DatawireQuarkCore::Static
Defined in:
lib/quark.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.



2886
2887
2888
2889
2890
2891
2892
2893
# File 'lib/quark.rb', line 2886

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.



2879
2880
2881
# File 'lib/quark.rb', line 2879

def _class
  @_class
end

#_underlyingObject

Returns the value of attribute _underlying.



2879
2880
2881
# File 'lib/quark.rb', line 2879

def _underlying
  @_underlying
end

Instance Method Details

#__init_fields__Object



2941
2942
2943
2944
2945
2946
2947
# File 'lib/quark.rb', line 2941

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

    nil
end

#_getClassObject



2909
2910
2911
2912
2913
2914
# File 'lib/quark.rb', line 2909

def _getClass()
    
    return "quark._CallIfIsInstance"

    nil
end

#_getField(name) ⇒ Object



2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
# File 'lib/quark.rb', line 2916

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



2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
# File 'lib/quark.rb', line 2929

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



2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
# File 'lib/quark.rb', line 2898

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

    nil
end