End of Life Ruby 3.1 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
instance method
ERB#result
result(b=new_toplevel)
lib/erb.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.1.3/lib/erb.rb, line 900
def result(b=new_toplevel)
unless @_init.equal?(self.class.singleton_class)
raise ArgumentError, "not initialized"
end
eval(@src, b, (@filename || '(erb)'), @lineno)
end
Executes the generated ERB code to produce a completed template, returning the results of that code. (See ERB::new for details on how this process can be affected by safe_level.)
b accepts a Binding object which is used to set the context of code evaluation.
See also
#new_toplevel
#result_with_hash
#make_compiler
#run
also in
4.1 · 4.0 · 3.4 · 3.3 · 3.2 · 3.0