Returns a list of the public instance methods defined in mod. If the optional parameter is false
, the methods of any ancestors are not included.
Returns a list of the protected instance methods defined in mod. If the optional parameter is false
, the methods of any ancestors are not included.
Removes the definition of the sym, returning that constant’s value.
class Dummy @@var = 99 puts @@var remove_class_variable(:@@var) p(defined? @@var) end
produces:
99 nil
Returns the value of the given class variable (or throws a NameError
exception). The @@
part of the variable name should be included for regular class variables. String arguments are converted to symbols.
class Fred @@foo = 99 end Fred.class_variable_get(:@@foo) #=> 99
Sets the class variable named by symbol to the given object. If the class variable name is passed as a string, that string is converted to a symbol.
class Fred @@foo = 99 def foo @@foo end end Fred.class_variable_set(:@@foo, 101) #=> 101 Fred.new.foo #=> 101
Returns true
if the given class variable is defined in obj. String arguments are converted to symbols.
class Fred @@foo = 99 end Fred.class_variable_defined?(:@@foo) #=> true Fred.class_variable_defined?(:@@bar) #=> false
Similar to instance_method, searches public method only.
Returns true
if the named private method is defined by _ mod_ (or its included modules and, if mod is a class, its ancestors). String arguments are converted to symbols.
module A def method1() end end class B private def method2() end end class C < B include A def method3() end end A.method_defined? :method1 #=> true C.private_method_defined? "method1" #=> false C.private_method_defined? "method2" #=> true C.method_defined? "method2" #=> false
Makes existing class methods private. Often used to hide the default constructor new
.
String arguments are converted to symbols.
class SimpleSingleton # Not thread safe private_class_method :new def SimpleSingleton.create(*args, &block) @me = new(*args, &block) if ! @me @me end end
Re-composes a prime factorization and returns the product.
See Prime#int_from_prime_division
for more details.
Returns true for IPv6 unique local address (fc00::/7, RFC4193). It returns false otherwise.
Returns true for IPv6 multicast node-local scope address. It returns false otherwise.
Returns true for IPv6 multicast link-local scope address. It returns false otherwise.
Returns true for IPv6 multicast site-local scope address. It returns false otherwise.
Returns true for IPv6 multicast organization-local scope address. It returns false otherwise.
Returns true for IPv6 multicast global scope address. It returns false otherwise.
Prints all threads in @thread_list to @stdout. Returns a sorted array of values from the @thread_list hash.
While in the debugger you can list all of the threads with: DEBUGGER__.thread_list_all
(rdb:1) DEBUGGER__.thread_list_all +1 #<Thread:0x007fb2320c03f0 run> debug_me.rb.rb:3 2 #<Thread:0x007fb23218a538@debug_me.rb.rb:3 sleep> 3 #<Thread:0x007fb23218b0f0@debug_me.rb.rb:3 sleep> [1, 2, 3]
Your current thread is indicated by a +
Additionally you can list all threads with th l
(rdb:1) th l +1 #<Thread:0x007f99328c0410 run> debug_me.rb:3 2 #<Thread:0x007f9932938230@debug_me.rb:3 sleep> debug_me.rb:3 3 #<Thread:0x007f9932938e10@debug_me.rb:3 sleep> debug_me.rb:3
See DEBUGGER__
for more usage.
Breaks the buffer into lines that are shorter than maxwidth
Raises PStore::Error
if the calling code is not in a PStore#transaction
or if the code is in a read-only PStore#transaction
.
Re-composes a prime factorization and returns the product.
See Prime#int_from_prime_division
for more details.
Returns the directories in the current shell’s PATH environment variable as an array of directory names. This sets the system_path
for all instances of Shell
.
Example: If in your current shell, you did:
$ echo $PATH /usr/bin:/bin:/usr/local/bin
Running this method in the above shell would then return:
["/usr/bin", "/bin", "/usr/local/bin"]
Sets the system_path
that new instances of Shell
should have as their initial system_path.
path
should be an array of directory name strings.