Sha256: b1b88782319b86dc30312d39ef4f04842cbbd81da0cfea864df2f682ce99c1aa

Contents?: true

Size: 1.78 KB

Versions: 12

Compression:

Stored size: 1.78 KB

Contents

o:$YARD::CodeObjects::MethodObject:
@name:local_variables:@docstringIC:YARD::Docstring"ŠReturns the names of the current local variables.

   fred = 1
   for i in 1..10
      # ...
   end
   local_variables   #=> ["fred", "i"]
:@objectu:YARD::StubProxyKernel#local_variables:
@summary0:	@all"¸Returns the names of the current local variables.

   fred = 1
   for i in 1..10
      # ...
   end
   local_variables   #=> ["fred", "i"]


@overload local_variables
  @return [Array]:@ref_tags[:
@tags[o:YARD::Tags::OverloadTag
;
u;Kernel#local_variables;;;IC;	"
;
u;Kernel#local_variables;0;
"@return [Array];[;[o:YARD::Tags::Tag
;
0;0:@types["
Array:
@text":@tag_name"return;0:@parameters[;0:@signature"local_variables;"
overload:@current_file_has_commentsF:@scope:
instance;[:@docstring_extra0:@files[["eval.c0:@namespaceu;Kernel:
@path"Kernel#local_variables;[:@visibility:public:@source"\/*
 *  call-seq:
 *     local_variables    => array
 *  
 *  Returns the names of the current local variables.
 *     
 *     fred = 1
 *     for i in 1..10
 *        # ...
 *     end
 *     local_variables   #=> ["fred", "i"]
 */

static VALUE
rb_f_local_variables()
{
    ID *tbl;
    int n, i;
    VALUE ary = rb_ary_new();
    struct RVarmap *vars;

    tbl = ruby_scope->local_tbl;
    if (tbl) {
    n = *tbl++;
    for (i=2; i<n; i++) {  /* skip first 2 ($_ and $~) */
        if (!rb_is_local_id(tbl[i])) continue; /* skip flip states */
        rb_ary_push(ary, rb_str_new2(rb_id2name(tbl[i])));
    }
    }

    vars = ruby_dyna_vars;
    while (vars) {
    if (vars->id && rb_is_local_id(vars->id)) { /* skip $_, $~ and flip states */
        rb_ary_push(ary, rb_str_new2(rb_id2name(vars->id)));
    }
    vars = vars->next;
    }

    return ary;
}:@source_type:c

Version data entries

12 entries across 12 versions & 2 rubygems

Version Path
pry-doc-0.4.4 lib/pry-doc/core_docs_18/objects/Kernel/local_variables_i.dat
pry-doc-0.4.3 lib/pry-doc/core_docs_18/objects/Kernel/local_variables_i.dat
pry-doc-0.4.2 lib/pry-doc/core_docs_18/objects/Kernel/local_variables_i.dat
pry-doc-0.4.1 lib/pry-doc/core_docs_18/objects/Kernel/local_variables_i.dat
pry-doc-0.4.0 lib/pry-doc/core_docs_18/objects/Kernel/local_variables_i.dat
pry-doc-0.3.0 lib/pry-doc/core_docs_18/objects/Kernel/local_variables_i.dat
pry-doc-0.2.4pre1 lib/pry-doc/core_docs_18/objects/Kernel/local_variables_i.dat
pry-doc-0.2.3pre1 lib/pry-doc/core_docs_18/objects/Kernel/local_variables_i.dat
pry-doc-0.2.1 lib/pry-doc/core_docs_18/objects/Kernel/local_variables_i.dat
pry-doc-0.2.0 lib/pry-doc/core_docs_18/objects/Kernel/local_variables_i.dat
pry-doc-0.1.5pre1 lib/pry-doc/core_docs_18/objects/Kernel/local_variables_i.dat
pry-0.6.9pre1-i386-mingw32 lib/pry/core_docs_18/objects/Kernel/local_variables_i.dat