DecodeSourceDecodeLanguageRubyGeneric

class Generic

Represents the Ruby language implementation for parsing and analysis.

Definitions

def parser

Get the parser for Ruby source code.

Signature

returns Language::Ruby::Parser

The Ruby parser instance.

Implementation

def parser
	@parser ||= Parser.new(self)
end

def reference_for(identifier)

Generate a language-specific reference for Ruby.

Signature

parameter identifier String

A valid Ruby identifier.

returns Reference

A Ruby-specific reference object.

Implementation

def reference_for(identifier)
	Reference.new(identifier, self)
end

def code_for(text, index, relative_to: nil)

Generate a code representation with syntax highlighting and link resolution.

Signature

parameter text String

The source code text to format.

parameter index Index

The index for resolving references.

parameter relative_to Definition

The definition to resolve relative references from.

returns Code

A formatted code object with syntax highlighting.

Implementation

def code_for(text, index, relative_to: nil)
	Code.new(text, index, relative_to: relative_to, language: self)
end