class Glass::Template

Attributes

template_name[RW]
timeline_item[RW]

Public Class Methods

new(opts={}) click to toggle source

then your template name would be: “tweets/blue”

Calls superclass method
# File lib/glass/template.rb, line 23
def initialize(opts={})
  self.template_name = opts.delete(:template_name) || "simple"
  set_template_instance_variables(opts)
  super(glass_template_path)
end

Public Instance Methods

render_self() click to toggle source
# File lib/glass/template.rb, line 28
def render_self
  self.render template: self.template_name
end

Private Instance Methods

glass_template_path() click to toggle source

just for convenience.

# File lib/glass/template.rb, line 41
def glass_template_path
  ::Glass.glass_template_path
end
set_template_instance_variables(opts) click to toggle source

substantiate the instance variables needed by action view for rendering in the erb templates.

# File lib/glass/template.rb, line 37
def set_template_instance_variables(opts)
  opts.each {|k,v| self.instance_variable_set("@#{k}", v) }
end