class Reference
An reference which can be resolved to zero or more definitions.
Definitions
def initialize(identifier, language, lexical_path = nil)
Initialize the reference.
Signature
-
parameter
identifier
String
The identifier part of the reference.
Implementation
def initialize(identifier, language, lexical_path = nil)
@identifier = identifier
@language = language
@lexical_path = lexical_path
@path = nil
end
attr :identifier
The identifier part of the reference.
Signature
-
attribute
String
attr :language
The language associated with this reference.
Signature
-
attribute
Language::Generic
def absolute?
Whether the reference starts at the base of the lexical tree.
Implementation
def absolute?
!self.relative?
end
def path
The lexical path of the reference.
Signature
-
returns
Array(String)
Implementation
def path
@path ||= self.lexical_path.map{|_, name| name.to_sym}
end