Module: Decode::Language::Ruby
- Defined in:
- lib/decode/language/ruby.rb,
lib/decode/language/ruby/call.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, 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
-
.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
.definitions_for(input, &block) ⇒ Object
Parse the input yielding definitions.
76 77 78 |
# File 'lib/decode/language/ruby.rb', line 76 def self.definitions_for(input, &block) Parser.new.definitions_for(input, &block) end |
.extensions ⇒ Object
43 44 45 |
# File 'lib/decode/language/ruby.rb', line 43 def self.extensions ['.rb', '.ru'] end |
.name ⇒ Object
The canoical name of the language for use in output formatting. e.g. source code highlighting.
35 36 37 |
# File 'lib/decode/language/ruby.rb', line 35 def self.name "ruby" end |
.names ⇒ Object
39 40 41 |
# File 'lib/decode/language/ruby.rb', line 39 def self.names [self.name] end |
.reference_for(identifier) ⇒ Object
Generate a language-specific reference.
67 68 69 |
# File 'lib/decode/language/ruby.rb', line 67 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.
86 87 88 |
# File 'lib/decode/language/ruby.rb', line 86 def self.segments_for(input, &block) Parser.new.segments_for(input, &block) end |
.tags ⇒ Object
61 62 63 |
# File 'lib/decode/language/ruby.rb', line 61 def self. TAGS end |