Class: Decode::Language::Ruby::Singleton
- Inherits:
-
Definition
- Object
- Definition
- Decode::Language::Ruby::Singleton
- Defined in:
- lib/decode/language/ruby/class.rb
Overview
A Ruby-specific singleton class.
Instance Attribute Summary
Attributes inherited from Definition
#The comment lines which directly preceeded the definition., #The language the symbol is defined within., #The path to the definition, relative to the parent., #The source file containing this definition., #comments, #language, #parent, #path, #source, #visibility
Instance Method Summary collapse
-
#container? ⇒ Boolean
A singleton class is a container for other definitions.
-
#coverage_relevant? ⇒ Boolean
Coverage is not relevant for singleton classes.
-
#nested? ⇒ Boolean
Typically, a singleton class does not contain other definitions.
-
#nested_name ⇒ Object
Generate a nested name for the singleton class.
-
#short_form ⇒ Object
(also: #long_form)
The short form of the class.
Methods inherited from Definition
#:public, :private, :protected=, #The parent definition, defining lexical scope.=, #The symbol name e.g. `:Decode`.=, #convert, #documentation, #documented?, #full_path, #initialize, #inspect, #location, #multiline?, #name, #public?, #qualified_form, #qualified_name, #start_with?, #text
Constructor Details
This class inherits a constructor from Decode::Definition
Instance Method Details
#container? ⇒ Boolean
A singleton class is a container for other definitions.
62 63 64 |
# File 'lib/decode/language/ruby/class.rb', line 62 def container? true end |
#coverage_relevant? ⇒ Boolean
Coverage is not relevant for singleton classes.
82 83 84 |
# File 'lib/decode/language/ruby/class.rb', line 82 def coverage_relevant? false end |
#nested? ⇒ Boolean
Typically, a singleton class does not contain other definitions.
68 69 70 |
# File 'lib/decode/language/ruby/class.rb', line 68 def nested? false end |
#nested_name ⇒ Object
Generate a nested name for the singleton class.
56 57 58 |
# File 'lib/decode/language/ruby/class.rb', line 56 def nested_name "class" end |
#short_form ⇒ Object Also known as: long_form
The short form of the class. e.g. ‘class << self`.
74 75 76 |
# File 'lib/decode/language/ruby/class.rb', line 74 def short_form "class << #{self.name}" end |