Class: Shackleton::Mapper
- Inherits:
-
Object
- Object
- Shackleton::Mapper
- Defined in:
- lib/shackleton/mapper.rb
Instance Method Summary collapse
-
#initialize(&block) ⇒ Mapper
constructor
A new instance of Mapper.
- #method_missing(method, *args, **kwargs, &block) ⇒ Object
Constructor Details
#initialize(&block) ⇒ Mapper
4 5 6 |
# File 'lib/shackleton/mapper.rb', line 4 def initialize &block @root = Shackleton::Route.new(&block) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args, **kwargs, &block) ⇒ Object
8 9 10 11 |
# File 'lib/shackleton/mapper.rb', line 8 def method_missing(method, *args, **kwargs, &block) return Shackleton::Builder.new.add_route(@root[method.to_sym], kwargs) if @root[method.to_sym] super end |