lib/measures/tbd/resources/model.rb
def sequential?
      n = @directed_edges.size
      @directed_edges.each_index do |i|
        break if i == n-1

        # e.g. check if first edge v0 == last edge v
        #      check if each intermediate, nieghbouring v0 & v are equal
        #      e.g. by relying on 'inverted?'
        #      'answer = true' if all checks out
        return false if @directed_edges[i].v1.id != @directed_edges[i+1].v0.id
      end
      return true
    end
##
# Validates if directed edges are sequential
#
# @return [Bool] Returns true if sequential
Validates if directed edges are sequential
Validates if directed edges are sequential
def sequential?
      n = @directed_edges.size
      @directed_edges.each_index do |i|
        break if i == n-1
        return false if @directed_edges[i].v1.id != @directed_edges[i+1].v0.id
      end
      return true
    end
def sequential? n = @directed_edges . size @directed_edges . each_index do | i | break if i == n - 1 return false if @directed_edges [ i ] . v1 . id != @directed_edges [ i + 1 ] . v0 . id end return true end
Validates if directed edges are sequential
Validates if directed edges are sequential
# e.g. check if first edge v0 == last edge v #      check if each intermediate, nieghbouring v0 & v are equal #      e.g. by relying on 'inverted?' #      'answer = true' if all checks out
Returns true if sequential
Returns true if sequential
Bool