Module: Renee::Render::ClassMethods

Defined in:
lib/renee_render.rb

Overview

Class-methods included by this module.

Instance Method Summary collapse

Instance Method Details

#default_encoding(encoding = nil) ⇒ Object

Gets or sets the default encoding used.

Parameters:

  • encoding (String) (defaults to: nil)

    The encoding to use. e.g. "utf-8"



31
32
33
# File 'lib/renee_render.rb', line 31

def default_encoding(encoding = nil)
  encoding ? @encoding = encoding : @encoding
end

#default_layout(*args) ⇒ Object

Gets or sets the default layout used.

Parameters:

  • layout (String)

    The layout to use. e.g. "application.haml"



38
39
40
41
42
43
44
# File 'lib/renee_render.rb', line 38

def default_layout(*args)
  case args.size
  when 0 then @layout
  when 1 then @layout = args.first
  else        raise
  end
end

#views_path(path = nil) ⇒ Object

Gets or sets the views_path for an application.

Examples:

views_path("./views") => nil
views_path => "./views"

Parameters:

  • path (String) (defaults to: nil)

    The path to the view files.



24
25
26
# File 'lib/renee_render.rb', line 24

def views_path(path = nil)
  path ? @views_path = path : @views_path
end