Class: Exo::RoutePresenter

Inherits:
Struct
  • Object
show all
Defined in:
app/presenters/exo/route_presenter.rb

Constant Summary collapse

DEFAULT_LAYOUT =
'/application'

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#routeObject

Returns the value of attribute route

Returns:

  • (Object)

    the current value of 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

#blocksObject



25
26
27
# File 'app/presenters/exo/route_presenter.rb', line 25

def blocks
  route.blocks
end

#layout_pathObject



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

Returns:

  • (Boolean)


9
10
11
# File 'app/presenters/exo/route_presenter.rb', line 9

def nil?
  route.nil?
end

#redirection?Boolean

Returns:

  • (Boolean)


5
6
7
# File 'app/presenters/exo/route_presenter.rb', line 5

def redirection?
  route.class == Exo::Route::Redirection
end

#to_urlObject



13
14
15
# File 'app/presenters/exo/route_presenter.rb', line 13

def to_url
  route.to_url
end

#view_pathObject



17
18
19
# File 'app/presenters/exo/route_presenter.rb', line 17

def view_path
  route.site.nest_path route.view_path
end