DecodeSourceDecodeLanguageRubySingleton

class Singleton

A Ruby-specific singleton class.

Definitions

def nested_name

Generate a nested name for the singleton class.

Implementation

def nested_name
	"::class"
end

def container?

A singleton class is a container for other definitions.

Signature

returns Boolean

Implementation

def container?
	true
end

def nested?

Typically, a singleton class does not contain other definitions.

Signature

returns Boolean

Implementation

def nested?
	false
end

def short_form

The short form of the class. e.g. class << self.

Implementation

def short_form
	"class << #{self.name}"
end

alias long_form short_form

The long form is the same as the short form.