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 95 def append_view_subdir(v) 96 if subdir = @_view_subdir 97 set_view_subdir("#{subdir}/#{v}") 98 else 99 set_view_subdir(v) 100 end 101 end
set_layout_options(opts)
Set branch/route options to use when rendering the layout
[show source]
# File lib/roda/plugins/view_options.rb 110 def set_layout_options(opts) 111 if options = @_layout_options 112 @_layout_options = options.merge!(opts) 113 else 114 @_layout_options = opts 115 end 116 end
set_view_options(opts)
Set branch/route options to use when rendering the view
[show source]
# File lib/roda/plugins/view_options.rb 119 def set_view_options(opts) 120 if options = @_view_options 121 @_view_options = options.merge!(opts) 122 else 123 @_view_options = opts 124 end 125 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 105 def set_view_subdir(v) 106 @_view_subdir = v 107 end