Module: Roda::RodaPlugins::ViewOptions::InstanceMethods

Defined in:
lib/roda/plugins/view_options.rb

Overview

The following methods are created via metaprogramming:

set_layout_locals

Set locals to use in the layout

set_layout_options

Set options to use when rendering the layout

set_view_locals

Set locals to use in the view

set_view_options

Set options to use when rendering the view

Instance Method Summary collapse

Instance Method Details

#append_view_subdir(v) ⇒ Object

Append a view subdirectory to use. If there hasn’t already been a view subdirectory set, this just sets it to the argument. If there has already been a view subdirectory set, this sets the view subdirectory to a subdirectory of the existing view subdirectory.



114
115
116
117
118
119
120
# File 'lib/roda/plugins/view_options.rb', line 114

def append_view_subdir(v)
  if subdir = @_view_subdir
    set_view_subdir("#{subdir}/#{v}")
  else
    set_view_subdir(v)
  end
end

#set_view_subdir(v) ⇒ Object

Set the view subdirectory to use. This can be set to nil to not use a view subdirectory.



124
125
126
# File 'lib/roda/plugins/view_options.rb', line 124

def set_view_subdir(v)
  @_view_subdir = v
end