Class: Decode::Language::Ruby::Module

Inherits:
Definition
  • Object
show all
Defined in:
lib/decode/language/ruby/module.rb

Overview

A Ruby-specific module.

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

Methods inherited from Definition

#:public, :private, :protected=, #The parent definition, defining lexical scope.=, #The symbol name e.g. `:Decode`.=, #convert, #coverage_relevant?, #documentation, #documented?, #full_path, #initialize, #inspect, #location, #multiline?, #name, #nested?, #nested_name, #public?, #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.

Returns:

  • (Boolean)


14
15
16
# File 'lib/decode/language/ruby/module.rb', line 14

def container?
  true
end

#long_formObject

Generate a long form representation of the module.



25
26
27
# File 'lib/decode/language/ruby/module.rb', line 25

def long_form
  qualified_form
end

#qualified_formObject

The fully qualified name of the module. e.g. ‘module ::Barnyard::Dog`.



31
32
33
# File 'lib/decode/language/ruby/module.rb', line 31

def qualified_form
  "module #{self.qualified_name}"
end

#short_formObject

The short form of the module. e.g. ‘module Barnyard`.



20
21
22
# File 'lib/decode/language/ruby/module.rb', line 20

def short_form
  "module #{self.name}"
end