Method: IntelligentUtils#change_offset

Defined in:
lib/filestack/utils/utils.rb

#change_offset(working_offset, state) ⇒ Integer

Return current working offest if state has not tried it. Otherwise, return the next offset of the state

Parameters:

  • working_offset (Integer)

    The current offset

  • state (IntelligentState)

    An IntelligentState object

Returns:

  • (Integer)


191
192
193
194
195
196
197
# File 'lib/filestack/utils/utils.rb', line 191

def change_offset(working_offset, state)
  if state.offset > working_offset
    working_offset
  else
    state.offset = state.next_offset
  end
end