Class: Exo::RoutePresenter
- Inherits:
-
Struct
- Object
- Struct
- Exo::RoutePresenter
- Defined in:
- app/presenters/exo/route_presenter.rb
Constant Summary collapse
- DEFAULT_LAYOUT =
'/application'
Instance Attribute Summary collapse
-
#route ⇒ Object
Returns the value of attribute route.
Instance Method Summary collapse
- #block(slug_id) ⇒ Object
- #blocks ⇒ Object
- #layout_path ⇒ Object
- #nil? ⇒ Boolean
- #redirection? ⇒ Boolean
- #to_url ⇒ Object
- #view_path ⇒ Object
Instance Attribute Details
#route ⇒ Object
Returns the value of attribute route
2 3 4 |
# File 'app/presenters/exo/route_presenter.rb', line 2 def route @route end |
Instance Method Details
#block(slug_id) ⇒ Object
29 30 31 |
# File 'app/presenters/exo/route_presenter.rb', line 29 def block slug_id route.blocks.where(slug_id: slug_id.to_s).first end |
#blocks ⇒ Object
25 26 27 |
# File 'app/presenters/exo/route_presenter.rb', line 25 def blocks route.blocks end |
#layout_path ⇒ Object
21 22 23 |
# File 'app/presenters/exo/route_presenter.rb', line 21 def layout_path route.site.nest_path(route.layout_path || DEFAULT_LAYOUT) end |
#nil? ⇒ Boolean
9 10 11 |
# File 'app/presenters/exo/route_presenter.rb', line 9 def nil? route.nil? end |
#redirection? ⇒ Boolean
5 6 7 |
# File 'app/presenters/exo/route_presenter.rb', line 5 def redirection? route.class == Exo::Route::Redirection end |
#to_url ⇒ Object
13 14 15 |
# File 'app/presenters/exo/route_presenter.rb', line 13 def to_url route.to_url end |
#view_path ⇒ Object
17 18 19 |
# File 'app/presenters/exo/route_presenter.rb', line 17 def view_path route.site.nest_path route.view_path end |