class Infopark::Crm::Core::Enumerator

Transparent wrapper for the web services continuation ability

Public Class Methods

new(collection, continuation_handle, size, &block) click to toggle source

@private

Calls superclass method
# File lib/crm_connector/core/enumerator.rb, line 6
def initialize(collection, continuation_handle, size, &block)
  update(collection, continuation_handle, size)
  super(&block)
end

Public Instance Methods

continuation_handle() click to toggle source

The continuation_handle parameter to be passed to the next find or search request for programmatic paging. @return [String] @private

# File lib/crm_connector/core/enumerator.rb, line 16
def continuation_handle
  @continuation_handle
end
inspect() click to toggle source

@private

# File lib/crm_connector/core/enumerator.rb, line 46
def inspect
  "#{super.chop}, @within_limit=#{within_limit.inspect}" +
      ", @continuation_handle=#{continuation_handle.inspect}>"
end
update(collection, continuation_handle, size) click to toggle source

Note: We don't want size to return nil for compatibility for count's behavior @private

# File lib/crm_connector/core/enumerator.rb, line 38
def update(collection, continuation_handle, size)
  @collection = collection
  @continuation_handle = continuation_handle
  @size = size
  define_singleton_method(:size) {@size} if @size
end
within_limit() click to toggle source

The results of the last response as an array. The size of the array is less than or equal to the limit parameter value. @return [Array]

# File lib/crm_connector/core/enumerator.rb, line 24
def within_limit
  @collection.to_a
end