Class: Restaurant::Router
- Inherits:
-
Object
- Object
- Restaurant::Router
- Defined in:
- lib/restaurant/router.rb
Instance Attribute Summary collapse
-
#router ⇒ Object
readonly
Returns the value of attribute router.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(router) ⇒ Router
constructor
A new instance of Router.
- #route ⇒ Object
Constructor Details
#initialize(router) ⇒ Router
Returns a new instance of Router.
45 46 47 |
# File 'lib/restaurant/router.rb', line 45 def initialize(router) @router = router end |
Instance Attribute Details
#router ⇒ Object (readonly)
Returns the value of attribute router.
43 44 45 |
# File 'lib/restaurant/router.rb', line 43 def router @router end |
Class Method Details
.called? ⇒ Boolean
38 39 40 |
# File 'lib/restaurant/router.rb', line 38 def called? !!@called end |
.route(*args) ⇒ Object
33 34 35 36 |
# File 'lib/restaurant/router.rb', line 33 def route(*args) new(*args).route @called = true end |
Instance Method Details
#route ⇒ Object
49 50 51 52 |
# File 'lib/restaurant/router.rb', line 49 def route define_route define_controller end |