Sha256: 59f5d845fef7e53a1868dfbb7302170bb3c256e164ccc48d1de92c3b7904d2f3

Contents?: true

Size: 351 Bytes

Versions: 1

Compression:

Stored size: 351 Bytes

Contents

module Stamina
  class Automaton

    # Removes unreachable states from the initial ones
    def strip!
      depth(:reachable)
      drop_states(*states.select{|s| s[:reachable].nil?})
    end

    # Returns a copy of this automaton with unreachable states removed
    def strip
      dup.strip!
    end

  end # class Automaton
end # module Stamina

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
stamina-0.4.0 lib/stamina/automaton/strip.rb