Results for: "String#[]"

No documentation available
No documentation available
No documentation available
No documentation available
No documentation available
No documentation available

Processes the topmost available {RequirementState} on the stack @return [void]

@return [ResolutionState] the state whose ‘requirement` is the given

`requirement`.
No documentation available
No documentation available
No documentation available
No documentation available

Is this tar entry a symlink?

Rewinds to the beginning of the tar file entry

Writes data onto the IO, raising a FileOverflow exception if the number of bytes will be more than limit

Writes data onto the IO

@return [String] a string suitable for debugging

No documentation available

Same as Enumerator#with_index(0), i.e. there is no starting offset.

If no block is given, a new Enumerator is returned that includes the index.

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 named public 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
  protected
  def method2()  end
end
class C < B
  include A
  def method3()  end
end

A.method_defined? :method1           #=> true
C.public_method_defined? "method1"   #=> true
C.public_method_defined? "method2"   #=> false
C.method_defined? "method2"          #=> true

Returns true if the named protected 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
  protected
  def method2()  end
end
class C < B
  include A
  def method3()  end
end

A.method_defined? :method1              #=> true
C.protected_method_defined? "method1"   #=> false
C.protected_method_defined? "method2"   #=> true
C.method_defined? "method2"             #=> true

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
Search took: 5ms  ·  Total Results: 2910