Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should use a less common variable in templater #16

Open
thinkerbot opened this issue Nov 30, 2010 · 1 comment
Open

Should use a less common variable in templater #16

thinkerbot opened this issue Nov 30, 2010 · 1 comment

Comments

@thinkerbot
Copy link
Owner

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
Copy link
Owner Author

# 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant