Skip to content

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

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.