Module: Roda::RodaPlugins::Render::ClassMethods

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

Instance Method Summary collapse

Instance Method Details

#inherited(subclass) ⇒ Object

Copy the rendering options into the subclass, duping them as necessary to prevent changes in the subclass affecting the parent class.



129
130
131
132
133
134
135
136
# File 'lib/roda/plugins/render.rb', line 129

def inherited(subclass)
  super
  opts = subclass.opts[:render].dup
  opts[:layout_opts] = opts[:layout_opts].dup.extend(RodaDeprecateMutation)
  opts[:template_opts] = opts[:template_opts].dup.extend(RodaDeprecateMutation)
  opts[:cache] = thread_safe_cache if opts[:cache]
  subclass.opts[:render] = opts.extend(RodaDeprecateMutation)
end

#render_optsObject

Return the render options for this class.



139
140
141
# File 'lib/roda/plugins/render.rb', line 139

def render_opts
  opts[:render]
end