module Roda::RodaPlugins::ViewOptions::InstanceMethods

  1. lib/roda/plugins/view_options.rb

Public Instance methods

append_view_subdir(v)

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.

[show source]
    # File lib/roda/plugins/view_options.rb
 97 def append_view_subdir(v)
 98   if subdir = @_view_subdir
 99     set_view_subdir("#{subdir}/#{v}")
100   else
101     set_view_subdir(v)
102   end
103 end
set_layout_options(opts)

Set branch/route options to use when rendering the layout

[show source]
    # File lib/roda/plugins/view_options.rb
112 def set_layout_options(opts)
113   if options = @_layout_options
114     @_layout_options = options.merge!(opts)
115   else
116     @_layout_options = opts
117   end
118 end
set_view_options(opts)

Set branch/route options to use when rendering the view

[show source]
    # File lib/roda/plugins/view_options.rb
121 def set_view_options(opts)
122   if options = @_view_options
123     @_view_options = options.merge!(opts)
124   else
125     @_view_options = opts
126   end
127 end
set_view_subdir(v)

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

[show source]
    # File lib/roda/plugins/view_options.rb
107 def set_view_subdir(v)
108   @_view_subdir = v
109 end