Class: Js::Routes::Rails::RouteExporter

Inherits:
Object
  • Object
show all
Defined in:
lib/js-routes/rails/route_exporter.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(finder = nil) ⇒ RouteExporter

Returns a new instance of RouteExporter.



7
8
9
# File 'lib/js-routes/rails/route_exporter.rb', line 7

def initialize(finder = nil)
  @routes = finder.routes
end

Instance Attribute Details

#routesObject (readonly)

Returns the value of attribute routes.



5
6
7
# File 'lib/js-routes/rails/route_exporter.rb', line 5

def routes
  @routes
end

Instance Method Details

#export!Object



11
12
13
14
15
# File 'lib/js-routes/rails/route_exporter.rb', line 11

def export!
  File.open(configuration.output, 'w') do |f|
    f.write(compiled)
  end
end