Class: Node::ALIAS

Inherits:
Node show all
Defined in:
ext/internal/node/nodeinfo.c,
ext/internal/node/nodeinfo.c,
ext/cached/ruby-1.8.4/internal/node/nodeinfo.c,
ext/cached/ruby-1.8.4/internal/node/nodeinfo.c,
ext/cached/ruby-1.8.5/internal/node/nodeinfo.c,
ext/cached/ruby-1.8.5/internal/node/nodeinfo.c,
ext/cached/ruby-1.8.6/internal/node/nodeinfo.c,
ext/cached/ruby-1.8.6/internal/node/nodeinfo.c,
ext/cached/ruby-1.8.7/internal/node/nodeinfo.c,
ext/cached/ruby-1.8.7/internal/node/nodeinfo.c,
ext/cached/ruby-1.9.1/internal/node/nodeinfo.c,
ext/cached/ruby-1.9.1/internal/node/nodeinfo.c,
ext/cached/ruby-1.9.2/internal/node/nodeinfo.c,
ext/cached/ruby-1.9.2/internal/node/nodeinfo.c,
ext/cached/ruby-1.9.3/internal/node/nodeinfo.c,
ext/cached/ruby-1.9.3/internal/node/nodeinfo.c

Overview

Represents an alias expression of the form:

alias 1st 2nd

where 2nd is the name of an existing method and 1st is the name of its new alias.

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Node

#[], #_dump, _load, #address, #as_code, #as_expression, #as_paren_expression, #bytecode_compile, compile_string, define_code, define_expression, #eval, #flags, #inspect, #members, #nd_file, #nd_line, #nd_type, #obfusc, #pretty_print, #swap, #to_a, #tree, type

Class Method Details

.membersArray

Return an array of strings containing the names of the node class’s members.

Returns:

  • (Array)


2793
2794
2795
2796
# File 'ext/internal/node/nodeinfo.c', line 2793

VALUE node_s_members(VALUE klass)
{
  return rb_iv_get(klass, "__member__");
}

Instance Method Details

#firstObject

Return the Node’s 1st member. The return type is either a Node or an Object.



1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
# File 'ext/internal/node/nodeinfo.c', line 1937

static VALUE node_1st(VALUE self)
{
  NODE * n;
  Data_Get_Struct(self, NODE, n);

  if(TYPE(n->nd_1st) == T_NODE)
  {
    if(0 && nd_type(n) == NODE_OP_ASGN2)
    {
      return wrap_node_as(
        (NODE *)n->nd_1st,
        rb_cNodeSubclass[NODE_OP_ASGN2_ARG]);
    }
    else
    {
      return wrap_node((NODE *)n->nd_1st);
    }
  }
  else
  {
    return (VALUE)n->nd_1st;
  }
}

#secondObject

Return the Node’s 2nd member. The return type is either a Node or an Object.



1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
# File 'ext/internal/node/nodeinfo.c', line 1964

static VALUE node_2nd(VALUE self)
{
  NODE * n;
  Data_Get_Struct(self, NODE, n);

  if(TYPE(n->nd_2nd) == T_NODE)
  {
    if(0 && nd_type(n) == NODE_OP_ASGN2)
    {
      return wrap_node_as(
        (NODE *)n->nd_2nd,
        rb_cNodeSubclass[NODE_OP_ASGN2_ARG]);
    }
    else
    {
      return wrap_node((NODE *)n->nd_2nd);
    }
  }
  else
  {
    return (VALUE)n->nd_2nd;
  }
}