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



229
230
231
# File 'lib/tdl/exlib/itegration.rb', line 229

def clearLast  
    @_none_ = true
end

#setLastObject



225
226
227
# File 'lib/tdl/exlib/itegration.rb', line 225

def setLast  
    @_none_ = false
end

#slastObject



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

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



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

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

#wrap_nont_itgt(&block) ⇒ Object



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

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