Class: Exo::RouteDecorator

Inherits:
Draper::Decorator
  • Object
show all
Defined in:
app/presenters/exo/route_decorator.rb

Constant Summary collapse

DEFAULT_LAYOUT =
'/application'

Instance Method Summary collapse

Instance Method Details

#block_name(slug_id) ⇒ Object



19
20
21
# File 'app/presenters/exo/route_decorator.rb', line 19

def block_name slug_id
  object.blocks.where(slug_id: slug_id.to_s).first
end

#layout_pathObject



15
16
17
# File 'app/presenters/exo/route_decorator.rb', line 15

def layout_path
  object.site.nest_path(object.layout_path || DEFAULT_LAYOUT)
end

#redirection?Boolean

Returns:

  • (Boolean)


7
8
9
# File 'app/presenters/exo/route_decorator.rb', line 7

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

#view_pathObject



11
12
13
# File 'app/presenters/exo/route_decorator.rb', line 11

def view_path
  object.site.nest_path object.view_path
end