Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →
instance method
ERB#result
(?::Binding) -> ::String
result(binding = new_toplevel) → new_string
lib/erb.rb
View on GitHub ↗
# File tmp/rubies/ruby-4.1.0-preview1/lib/erb.rb, line 1060
def result(b=new_toplevel)
unless initialized_by_new?
raise ArgumentError, "not initialized"
end
eval(@src, b, (@filename || '(erb)'), @lineno)
end
Returns the string result formed by processing ERB tags found in the stored template in self.
With no argument given, uses the default binding; see Default Binding.
With argument binding given, uses the local binding; see Local Binding.
See also result_with_hash.
See also
#new_toplevel
#result_with_hash
#make_compiler
#run
also in
4.0 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0