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
Attributes inherited from Definition
#comments, #language, #name, #parent
Instance Method Summary collapse
-
#container? ⇒ Boolean
A module is a container for other definitions.
- #long_form ⇒ Object
- #nested_name ⇒ Object
- #path_name ⇒ Object
-
#qualified_form ⇒ Object
The fully qualified name of the class.
-
#short_form ⇒ Object
The short form of the module.
Methods inherited from Definition
#convert, #documentation, #initialize, #inspect, #location, #multiline?, #nested?, #path, #qualified_name, #start_with?, #text
Constructor Details
This class inherits a constructor from Decode::Definition
Instance Method Details
#container? ⇒ Boolean
A module is a container for other definitions.
14 15 16 |
# File 'lib/decode/language/ruby/module.rb', line 14 def container? true end |
#long_form ⇒ Object
28 29 30 |
# File 'lib/decode/language/ruby/module.rb', line 28 def long_form qualified_form end |
#nested_name ⇒ Object
18 19 20 |
# File 'lib/decode/language/ruby/module.rb', line 18 def nested_name "::#{name}" end |
#path_name ⇒ Object
38 39 40 |
# File 'lib/decode/language/ruby/module.rb', line 38 def path_name @name.to_s.split('::').map(&:to_sym) end |
#qualified_form ⇒ Object
The fully qualified name of the class. e.g. ‘module ::Barnyard::Dog`.
34 35 36 |
# File 'lib/decode/language/ruby/module.rb', line 34 def qualified_form "module #{self.qualified_name}" end |
#short_form ⇒ Object
The short form of the module. e.g. ‘module Barnyard`.
24 25 26 |
# File 'lib/decode/language/ruby/module.rb', line 24 def short_form "module #{path_name.last}" end |