Class: Js::Routes::Rails::RouteExporter
- Inherits:
-
Object
- Object
- Js::Routes::Rails::RouteExporter
- Defined in:
- lib/js-routes/rails/route_exporter.rb
Instance Attribute Summary collapse
-
#routes ⇒ Object
readonly
Returns the value of attribute routes.
Instance Method Summary collapse
- #export! ⇒ Object
-
#initialize(finder = nil) ⇒ RouteExporter
constructor
A new instance of RouteExporter.
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
#routes ⇒ Object (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 |