Module: YiffSpace::Utils::Routes
- Defined in:
- lib/yiffspace/utils/routes.rb
Overview
Allow Rails URL helpers to be used outside of views.
Class Method Summary collapse
- .method_missing(name) ⇒ Object
- .respond_to_missing? ⇒ Boolean
-
.target ⇒ Object
Lazily resolved so application is not referenced at load time.
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name) ⇒ Object (private)
16 17 18 |
# File 'lib/yiffspace/utils/routes.rb', line 16 def method_missing(name, *, &) target.send(name, *, &) end |
Class Method Details
.method_missing(name) ⇒ Object
16 17 18 |
# File 'lib/yiffspace/utils/routes.rb', line 16 def method_missing(name, *, &) target.send(name, *, &) end |
.respond_to_missing? ⇒ Boolean
20 21 22 |
# File 'lib/yiffspace/utils/routes.rb', line 20 def respond_to_missing?(...) target.respond_to?(...) end |
.target ⇒ Object
Lazily resolved so application is not referenced at load time.
27 28 29 |
# File 'lib/yiffspace/utils/routes.rb', line 27 def target Rails.application.routes.url_helpers end |