Class: Fasta::RoutesMapper
- Inherits:
-
Object
- Object
- Fasta::RoutesMapper
- Defined in:
- lib/fasta/services/routes_mapper.rb
Instance Method Summary collapse
-
#initialize(action, router) ⇒ RoutesMapper
constructor
A new instance of RoutesMapper.
- #reg(method, route, action_name) ⇒ Object
Constructor Details
#initialize(action, router) ⇒ RoutesMapper
Returns a new instance of RoutesMapper.
3 4 5 6 |
# File 'lib/fasta/services/routes_mapper.rb', line 3 def initialize(action, router) @action = action @router = router end |
Instance Method Details
#reg(method, route, action_name) ⇒ Object
8 9 10 |
# File 'lib/fasta/services/routes_mapper.rb', line 8 def reg(method, route, action_name) router.public_send(method, route, to: action.call(action_name)) end |