Module: Decode::Language::Ruby
- Defined in:
- lib/decode/language/ruby.rb,
lib/decode/language/ruby/call.rb,
lib/decode/language/ruby/code.rb,
lib/decode/language/ruby/block.rb,
lib/decode/language/ruby/class.rb,
lib/decode/language/ruby/method.rb,
lib/decode/language/ruby/module.rb,
lib/decode/language/ruby/parser.rb,
lib/decode/language/ruby/segment.rb,
lib/decode/language/ruby/constant.rb,
lib/decode/language/ruby/function.rb,
lib/decode/language/ruby/attribute.rb,
lib/decode/language/ruby/reference.rb,
lib/decode/language/ruby/definition.rb
Overview
An interface for extracting information from Ruby source code.
Defined Under Namespace
Classes: Attribute, Block, Call, Class, Code, Constant, Definition, Function, Method, Module, Parser, Reference, Segment, Singleton
Constant Summary collapse
- TAGS =
Comment::Tags.build do || ['attribute'] = Comment::Attribute ['parameter'] = Comment::Parameter ['yields'] = Comment::Yields ['returns'] = Comment::Returns ['raises'] = Comment::Raises ['throws'] = Comment::Throws ['reentrant'] = Comment::Pragma ['deprecated'] = Comment::Pragma ['blocking'] = Comment::Pragma ['asynchronous'] = Comment::Pragma end
Class Method Summary collapse
- .code_for(text, index, relative_to: nil) ⇒ Object
-
.definitions_for(input, &block) ⇒ Object
Parse the input yielding definitions.
- .extensions ⇒ Object
-
.name ⇒ Object
The canoical name of the language for use in output formatting.
- .names ⇒ Object
-
.reference_for(identifier) ⇒ Object
Generate a language-specific reference.
-
.segments_for(input, &block) ⇒ Object
Parse the input yielding segments.
- .tags ⇒ Object
Class Method Details
.code_for(text, index, relative_to: nil) ⇒ Object
91 92 93 |
# File 'lib/decode/language/ruby.rb', line 91 def self.code_for(text, index, relative_to: nil) Code.new(text, index, relative_to: relative_to, language: self) end |
.definitions_for(input, &block) ⇒ Object
Parse the input yielding definitions.
77 78 79 |
# File 'lib/decode/language/ruby.rb', line 77 def self.definitions_for(input, &block) Parser.new.definitions_for(input, &block) end |
.extensions ⇒ Object
44 45 46 |
# File 'lib/decode/language/ruby.rb', line 44 def self.extensions ['.rb', '.ru'] end |
.name ⇒ Object
The canoical name of the language for use in output formatting. e.g. source code highlighting.
36 37 38 |
# File 'lib/decode/language/ruby.rb', line 36 def self.name "ruby" end |
.names ⇒ Object
40 41 42 |
# File 'lib/decode/language/ruby.rb', line 40 def self.names [self.name] end |
.reference_for(identifier) ⇒ Object
Generate a language-specific reference.
68 69 70 |
# File 'lib/decode/language/ruby.rb', line 68 def self.reference_for(identifier) Reference.new(identifier, self) end |
.segments_for(input, &block) ⇒ Object
Parse the input yielding segments. Segments are constructed from a block of top level comments followed by a block of code.
87 88 89 |
# File 'lib/decode/language/ruby.rb', line 87 def self.segments_for(input, &block) Parser.new.segments_for(input, &block) end |
.tags ⇒ Object
62 63 64 |
# File 'lib/decode/language/ruby.rb', line 62 def self. TAGS end |