diff options
| author | BurdetteLamar <burdettelamar@yahoo.com> | 2025-09-17 21:27:28 +0100 |
|---|---|---|
| committer | git <svn-admin@ruby-lang.org> | 2025-09-17 20:49:35 +0000 |
| commit | 96272ba10090056974fb1de86623438a349cc318 (patch) | |
| tree | f920bed7f81a85e74b85d92360e3d30601ce46d7 | |
| parent | 3db3627ffba7e8793427b5336d9c48bc422682a0 (diff) | |
[ruby/erb] [DOC] Doc for #new_toplevel
https://github.com/ruby/erb/commit/dee5dd4da8
| -rw-r--r-- | lib/erb.rb | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/lib/erb.rb b/lib/erb.rb index 62b83e523c..d88cce9f4b 100644 --- a/lib/erb.rb +++ b/lib/erb.rb @@ -988,10 +988,21 @@ class ERB result(b) end - ## - # Returns a new binding each time *near* TOPLEVEL_BINDING for runs that do - # not specify a binding. - + # :markup: markdown + # + # :call-seq: + # new_toplevel(symbols) -> new_binding + # + # Returns a new binding based on `TOPLEVEL_BINDING`; + # used to create a default binding for a call to #result. + # + # See [Default Binding][default binding]. + # + # Argument `symbols` is an array of symbols; + # each symbol `symbol` is used to define (unless already defined) a variable in the binding + # whose name is `symbol` and whose value is `nil`. + # + # [default binding]: rdoc-ref:ERB@Default+Binding def new_toplevel(vars = nil) b = TOPLEVEL_BINDING if vars |
