A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://docs.ruby-lang.org/en/master/Digest/../syntax/../FrozenError.html below:

class FrozenError - Documentation for Ruby 3.5

class FrozenError

Raised when there is an attempt to modify a frozen object.

[1, 2, 3].freeze << 4

raises the exception:

FrozenError: can't modify frozen Array
Public Class Methods

Source

static VALUE
frozen_err_initialize(int argc, VALUE *argv, VALUE self)
{
    ID keywords[1];
    VALUE values[numberof(keywords)], options;

    argc = rb_scan_args(argc, argv, "*:", NULL, &options);
    keywords[0] = id_receiver;
    rb_get_kwargs(options, keywords, 0, numberof(values), values);
    rb_call_super(argc, argv);
    err_init_recv(self, values[0]);
    return self;
}

Construct a new FrozenError exception. If given the receiver parameter may subsequently be examined using the FrozenError#receiver method.

a = [].freeze
raise FrozenError.new("can't modify frozen array", receiver: a)
Public Instance Methods

Source

#define frozen_err_receiver name_err_receiver

Return the receiver associated with this FrozenError exception.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4