method

to_json

rails latest stable - Class: ActionDispatch::Journey::GTG::TransitionTable

Method deprecated or moved

This method is deprecated or moved on the latest stable version. The last existing version (v4.0.2) is shown here.

to_json()
public

No documentation available.

# File actionpack/lib/action_dispatch/journey/gtg/transition_table.rb, line 46
        def to_json
          require 'json'

          simple_regexp = Hash.new { |h,k| h[k] = {} }

          @regexp_states.each do |from, hash|
            hash.each do |re, to|
              simple_regexp[from][re.source] = to
            end
          end

          JSON.dump({
            regexp_states: simple_regexp,
            string_states: @string_states,
            accepting:     @accepting
          })
        end