Class: Decode::Language::Ruby::Generic
- Defined in:
- lib/decode/language/ruby/generic.rb
Overview
Represents the Ruby language implementation for parsing and analysis.
Constant Summary collapse
- EXTENSIONS =
[".rb", ".ru"]
- TAGS =
Comment::Tags.build do || ["attribute"] = Comment::Attribute ["constant"] = Comment::Constant ["parameter"] = Comment::Parameter ["option"] = Comment::Option ["yields"] = Comment::Yields ["returns"] = Comment::Returns ["raises"] = Comment::Raises ["throws"] = Comment::Throws ["deprecated"] = Comment::Pragma ["asynchronous"] = Comment::Pragma ["public"] = Comment::Pragma ["private"] = Comment::Pragma ["example"] = Comment::Example ["rbs"] = Comment::RBS end
Instance Attribute Summary
Attributes inherited from Generic
#The language name., #The supported file extensions., #extensions, #name, #tags
Instance Method Summary collapse
-
#code_for(text, index, relative_to: nil) ⇒ Object
Generate a code representation with syntax highlighting and link resolution.
-
#parser ⇒ Object
Get the parser for Ruby source code.
-
#reference_for(identifier) ⇒ Object
Generate a language-specific reference for Ruby.
Methods inherited from Generic
#The tag definitions.=, #definitions_for, #initialize, #names, #segments_for
Constructor Details
This class inherits a constructor from Decode::Language::Generic
Instance Method Details
#code_for(text, index, relative_to: nil) ⇒ Object
Generate a code representation with syntax highlighting and link resolution.
60 61 62 |
# File 'lib/decode/language/ruby/generic.rb', line 60 def code_for(text, index, relative_to: nil) Code.new(text, index, relative_to: relative_to, language: self) end |
#parser ⇒ Object
Get the parser for Ruby source code.
44 45 46 |
# File 'lib/decode/language/ruby/generic.rb', line 44 def parser @parser ||= Parser.new(self) end |
#reference_for(identifier) ⇒ Object
Generate a language-specific reference for Ruby.
51 52 53 |
# File 'lib/decode/language/ruby/generic.rb', line 51 def reference_for(identifier) Reference.new(identifier, self) end |