symbol

Symbol

ri

 ---------------------------------------------------------- Class: Symbol
       Symbol  objects represent names and some strings inside the Ruby
      interpreter. They are generated using the  :name  and  :"string" 
      literals syntax, and by the various  to_sym  methods. The same
       Symbol  object will be created for a given name or string for the
      duration of a program's execution, regardless of the context or
      meaning of that name. Thus if  Fred  is a constant in one context,
      a method in another, and a class in a third, the  Symbol   :Fred 
      will be the same object in all three contexts.
 
         module One
           class Fred
           end
           $f1 = :Fred
         end
         module Two
           Fred = 1
           $f2 = :Fred
         end
         def Fred()
         end
         $f3 = :Fred
         $f1.id   #=> 2514190
         $f2.id   #=> 2514190
         $f3.id   #=> 2514190
 
 ------------------------------------------------------------------------
 
 
 Class methods:
 --------------
      all_symbols
 
 
 Instance methods:
 -----------------
      ===, id2name, inspect, to_i, to_int, to_s, to_sym

refe

 ==== Symbol ====
 * sym = Symbol.new(addr, type = nil, name = nil)
 #   * creates the Symbol object sym with the type type if type is not nil. addr
 #     is the address where the function is allocated. If type is nil, it returns
 #     a DataPtr object.
 
   * typenil でないなら 型 typeSymbol オブジェクト sym を作成する。
     関数が割り当てられているなら addr はそのアドレスtypenil なら
     DataPtr オブジェクトを返す。
 
 * Symbol::char2type(char)
 #   * takes a character char that represents a type and returns the type
 #     specifier of the C language.
   * 型に相当する文字 char を取り、C 言語の型修飾を返す。
 
 * str = Symbol#proto()
 #   * returns the function prototype.
   * 関数プロトタイプを返す。
 
 * str = Symbol#name()
 #   * Returns the function name.
   * 関数名を返す。
 
 * str = Symbol#cproto(),
   str = Symbol#to_s()
 #   * returns the prototype of the C language.
   * C 言語形式のプロトタイプを返す。
 
 * str = Symbol#inspect()
 #   * returns the inspectable string.
   * 人間が読みやすい形式の文字列を返す(訳注:意訳)。
 
 * r,rs = Symbol#call(arg1,arg2,...,argN),
   r,rs = Symbol#[](arg1,arg2,...,argN)
 #   * calls the function with parameters arg1, arg2, ..., argN. and the result
 #     consists of the return value r and parameters rs. rs is an array.
   * パラメータ arg1, arg2, ... argN で関数を呼び出す。結果は、戻り値 r 
     やパラメータrs からなる。rs は配列* ptr = Symbol#to_ptr
 #   * returns the corresponding PtrData object ptr.
   * 対応する PtrData オブジェクト ptr を返す。
 ---- Singleton methods ----
 all_symbols
 ---- Instance methods ----
 id2name to_i to_s to_sym
 ---- Singleton methods (inherited) ----
 ---- Instance methods (inherited) ----
 == === =~ __id__ __send__ _dump _load class clone display
 dup eql? equal? extend freeze frozen? hash id initialize
 initialize_copy inspect instance_eval instance_of?
 instance_variable_get instance_variable_set
 instance_variables is_a? kind_of? marshal_dump marshal_load
 method method_missing methods nil? object_id pretty_print
 pretty_print_cycle pretty_print_instance_variables
 private_methods protected_methods public_methods
 remove_instance_variable respond_to? send
 singleton_method_added singleton_method_removed
 singleton_method_undefined singleton_methods taint tainted?
 to_a to_ary to_hash to_int to_str type untaint