Class: Decode::Language::Ruby::Module
- Inherits:
-
Definition
- Object
- Definition
- Decode::Language::Ruby::Module
- Defined in:
- lib/decode/language/ruby/module.rb
Overview
A Ruby-specific module.
Instance Attribute Summary collapse
-
#extends ⇒ Object
readonly
Returns the value of attribute extends.
-
#includes ⇒ Object
readonly
Returns the value of attribute includes.
- #Modules extended into this module (adds singleton methods).(extendedintothis) ⇒ Object readonly
- #Modules included into this module.(includedintothis) ⇒ Object readonly
- #Modules prepended into this module (method lookup precedence).(prependedintothis) ⇒ Object readonly
-
#prepends ⇒ Object
readonly
Returns the value of attribute prepends.
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 module is a container for other definitions.
-
#initialize(*arguments, **options) ⇒ Module
constructor
Initialize a module with its name and options.
-
#long_form ⇒ Object
Generate a long form representation of the module.
-
#qualified_form ⇒ Object
The fully qualified name of the module.
-
#short_form ⇒ Object
The short form of the module.
Methods inherited from Definition
#:public, :private, :protected=, #The parent definition, defining lexical scope.=, #The symbol name e.g. `:Decode`.=, #alias?, #convert, #coverage_relevant?, #documentation, #documented?, #full_path, #inspect, #location, #multiline?, #name, #nested?, #nested_name, #public?, #qualified_name, #start_with?, #text
Constructor Details
#initialize(*arguments, **options) ⇒ Module
Initialize a module with its name and options.
14 15 16 17 18 19 20 |
# File 'lib/decode/language/ruby/module.rb', line 14 def initialize(*arguments, **) super(*arguments, **) @includes = [] @extends = [] @prepends = [] end |
Instance Attribute Details
#extends ⇒ Object (readonly)
Returns the value of attribute extends.
26 27 28 |
# File 'lib/decode/language/ruby/module.rb', line 26 def extends @extends end |
#includes ⇒ Object (readonly)
Returns the value of attribute includes.
23 24 25 |
# File 'lib/decode/language/ruby/module.rb', line 23 def includes @includes end |
#Modules extended into this module (adds singleton methods).(extendedintothis) ⇒ Object (readonly)
26 |
# File 'lib/decode/language/ruby/module.rb', line 26 attr :extends |
#Modules included into this module.(includedintothis) ⇒ Object (readonly)
23 |
# File 'lib/decode/language/ruby/module.rb', line 23 attr :includes |
#Modules prepended into this module (method lookup precedence).(prependedintothis) ⇒ Object (readonly)
29 |
# File 'lib/decode/language/ruby/module.rb', line 29 attr :prepends |
#prepends ⇒ Object (readonly)
Returns the value of attribute prepends.
29 30 31 |
# File 'lib/decode/language/ruby/module.rb', line 29 def prepends @prepends end |
Instance Method Details
#container? ⇒ Boolean
A module is a container for other definitions.
32 33 34 |
# File 'lib/decode/language/ruby/module.rb', line 32 def container? true end |
#long_form ⇒ Object
Generate a long form representation of the module.
43 44 45 |
# File 'lib/decode/language/ruby/module.rb', line 43 def long_form qualified_form end |
#qualified_form ⇒ Object
The fully qualified name of the module. e.g. ‘module ::Barnyard::Dog`.
49 50 51 |
# File 'lib/decode/language/ruby/module.rb', line 49 def qualified_form "module #{self.qualified_name}" end |
#short_form ⇒ Object
The short form of the module. e.g. ‘module Barnyard`.
38 39 40 |
# File 'lib/decode/language/ruby/module.rb', line 38 def short_form "module #{self.name}" end |