Class: Ant::Design::Rails::Routes
- Inherits:
-
Object
- Object
- Ant::Design::Rails::Routes
- Extended by:
- Forwardable
- Includes:
- Enumerable
- Defined in:
- lib/ant/design/rails/routes.rb
Instance Method Summary collapse
- #end_of_json ⇒ Object
-
#initialize(routes_ts_path) ⇒ Routes
constructor
A new instance of Routes.
- #start_of_json ⇒ Object
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_json ⇒ Object
23 24 25 |
# File 'lib/ant/design/rails/routes.rb', line 23 def end_of_json @body.rindex(']') end |
#start_of_json ⇒ Object
19 20 21 |
# File 'lib/ant/design/rails/routes.rb', line 19 def start_of_json @body.index('[') end |