Skip to content
class method

Psych.safe_load_file

(::path, ?permitted_classes: ::Array[::Class], ?permitted_symbols: ::Array[::Symbol], ?aliases: bool, ?fallback: untyped, ?symbolize_names: bool, ?freeze: bool) -> untyped
safe_load_file(filename, **kwargs)

Safely loads the document contained in filename. Returns the yaml contained in filename as a Ruby object, or if the file is empty, it returns the specified fallback return value, which defaults to nil. See safe_load for options.

See also .safe_load .safe_load_stream .safe_dump .to_json also in 4.1 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0