Class: Ant::Design::Rails::Routes

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Includes:
Enumerable
Defined in:
lib/ant/design/rails/routes.rb

Instance Method Summary collapse

Constructor Details

#initialize(routes_ts_path) ⇒ Routes

Returns a new instance of Routes.



14
15
16
17
# File 'lib/ant/design/rails/routes.rb', line 14

def initialize(routes_ts_path)
  @body = File.read(routes_ts_path)
  @result_array = ExecJS.eval(@body[start_of_json..end_of_json])
end

Instance Method Details

#end_of_jsonObject



23
24
25
# File 'lib/ant/design/rails/routes.rb', line 23

def end_of_json
  @body.rindex(']')
end

#start_of_jsonObject



19
20
21
# File 'lib/ant/design/rails/routes.rb', line 19

def start_of_json
  @body.index('[')
end