Module: Kiss::TemplateMethods

Included in:
Action, Mailer, Template
Defined in:
lib/kiss/accessors/template.rb

Instance Method Summary collapse

Instance Method Details

#dataObject Also known as: vars

Contains data set by action/mailer logic to be displayed in templates.



4
5
6
# File 'lib/kiss/accessors/template.rb', line 4

def data
  @data
end

#data=(hash) ⇒ Object Also known as: vars=



9
10
11
# File 'lib/kiss/accessors/template.rb', line 9

def data=(hash)
  @data = hash
end

#set(vars) ⇒ Object

Merges specified data (key-value pairs) into template data hash (provided for backward-compatibility with apps pre-1.2).



16
17
18
19
20
21
# File 'lib/kiss/accessors/template.rb', line 16

def set(vars)
  vars.each_pair do |key, value|
    @data[key] = value
    self.instance_variable_set(:"@#{key}", value)
  end
end