Method: QuickBase::Client#chainAPIcallsBlock

Defined in:
lib/QuickBaseClient.rb

#chainAPIcallsBlockObject

This method changes all the API_ wrapper methods to return ‘self’ instead of their normal return values. The change is in effect only within the associated block. This allows mutliple API_ calls to be ‘chained’ together without needing ‘qbClient’ in front of each call.

e.g. qbClient.chainAPIcallsBlock {

  qbClient
     .addField( @dbid, "a text field", "text" )
     .addField( @dbid, "a choice field", "text" )
     .fieldAddChoices( @dbid, @fid, %w{ one two three four five } )
}


3189
3190
3191
3192
3193
3194
3195
# File 'lib/QuickBaseClient.rb', line 3189

def chainAPIcallsBlock
   if block_given?
      @chainAPIcalls = true
      yield
   end
   @chainAPIcalls = nil
end