Sha256: 1ec089c747da476f637504f8f9919dfe74182f3c45d1054ff2abc3c9da672ed6
Contents?: true
Size: 1.99 KB
Versions: 12
Compression:
Stored size: 1.99 KB
Contents
o:$YARD::CodeObjects::MethodObject: @name:freeze:@docstringIC:YARD::Docstring"\Prevents further modifications to <i>obj</i>. A <code>TypeError</code> will be raised if modification is attempted. There is no way to unfreeze a frozen object. See also <code>Object#frozen?</code>. a = [ "a", "b", "c" ] a.freeze a << "z" <em>produces:</em> prog.rb:3:in `<<': can't modify frozen array (TypeError) from prog.rb:3 :@objectu:YARD::StubProxyObject#freeze: @summary0: @all"�Prevents further modifications to <i>obj</i>. A <code>TypeError</code> will be raised if modification is attempted. There is no way to unfreeze a frozen object. See also <code>Object#frozen?</code>. a = [ "a", "b", "c" ] a.freeze a << "z" <em>produces:</em> prog.rb:3:in `<<': can't modify frozen array (TypeError) from prog.rb:3 @overload freeze @return [Object]:@ref_tags[: @tags[o:YARD::Tags::OverloadTag ; u;Object#freeze;;;IC; " ; u;Object#freeze;0; "@return [Object];[;[o:YARD::Tags::Tag ; 0;0:@types["Object: @text":@tag_name"return;0:@parameters[;0:@signature"freeze;" overload:@current_file_has_commentsF:@scope: instance;[:@docstring_extra0:@files[[" object.c0:@namespaceu;Object: @path"Object#freeze;[:@visibility:public:@source"�/* * call-seq: * obj.freeze => obj * * Prevents further modifications to <i>obj</i>. A * <code>TypeError</code> will be raised if modification is attempted. * There is no way to unfreeze a frozen object. See also * <code>Object#frozen?</code>. * * a = [ "a", "b", "c" ] * a.freeze * a << "z" * * <em>produces:</em> * * prog.rb:3:in `<<': can't modify frozen array (TypeError) * from prog.rb:3 */ VALUE rb_obj_freeze(obj) VALUE obj; { if (!OBJ_FROZEN(obj)) { if (rb_safe_level() >= 4 && !OBJ_TAINTED(obj)) { rb_raise(rb_eSecurityError, "Insecure: can't freeze object"); } OBJ_FREEZE(obj); } return obj; }:@source_type:c
Version data entries
12 entries across 12 versions & 2 rubygems