Method: ActionDispatch::Journey::GTG::TransitionTable#as_json

Defined in:
actionpack/lib/action_dispatch/journey/gtg/transition_table.rb

#as_json(options = nil) ⇒ Object



100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
# File 'actionpack/lib/action_dispatch/journey/gtg/transition_table.rb', line 100

def as_json(options = nil)
  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

  {
    regexp_states:   simple_regexp,
    string_states:   @string_states,
    stdparam_states: @stdparam_states,
    accepting:       @accepting
  }
end