Class: ItgtArray

Inherits:
Array
  • Object
show all
Defined in:
lib/tdl/exlib/itegration.rb

Overview

定义隐性的itgt 这样可以不带参数地调用 to_inp

Instance Method Summary collapse

Instance Method Details

#clearLastObject



231
232
233
# File 'lib/tdl/exlib/itegration.rb', line 231

def clearLast  
    @_none_ = true
end

#setLastObject



227
228
229
# File 'lib/tdl/exlib/itegration.rb', line 227

def setLast  
    @_none_ = false
end

#slastObject



218
219
220
221
222
223
224
225
# File 'lib/tdl/exlib/itegration.rb', line 218

def slast  
    # $_implicit_curr_itgt_.instance_variable_set("@_none_",$_implicit_curr_itgt_.last)
    unless @_none_
        return self.last
    else 
        return nil 
    end
end

#with_none_itgt(&block) ⇒ Object



235
236
237
238
239
240
# File 'lib/tdl/exlib/itegration.rb', line 235

def with_none_itgt(&block)
    clearLast
    rels = yield
    setLast
    rels
end

#wrap_nont_itgt(&block) ⇒ Object



242
243
244
245
246
247
248
249
250
251
# File 'lib/tdl/exlib/itegration.rb', line 242

def wrap_nont_itgt(&block)
    _self = self
    # Proc.new do |itgt|
    #     _self.clearLast
    #     rels = block.call
    #     _self.setLast
    #     rels
    # end
    return block
end