tap icon indicating copy to clipboard operation
tap copied to clipboard

Should use a less common variable in templater

Open thinkerbot opened this issue 14 years ago • 1 comments

Like attrs or similar... otherwise attrs cannot be used as a variable.

# Build the template, setting the attributes and filename if specified.
# All methods of self will be accessible in the template.
def build(attrs=nil, filename=nil)
  attrs.each_pair do |key, value|
    send("#{key}=", value)
  end if attrs

  @template.filename = filename
  @template.result(binding)
  @_erbout
end

thinkerbot avatar Nov 30 '10 21:11 thinkerbot

# Build the template, setting the attributes and filename if specified.
# All methods of self will be accessible in the template.
def build(_attrs_=nil, _filename_=nil)
  _attrs_.each_pair do |key, value|
    send("#{key}=", value)
  end if _attrs_

  @template.filename = _filename_
  @template.result(binding)
  @_erbout
end

thinkerbot avatar Dec 15 '10 16:12 thinkerbot