Class: YARD::Parser::RBS::Statement
| Relationships & Source Files | |
| Inherits: | Object |
| Defined in: | lib/yard/parser/rbs/statement.rb |
Overview
Represents a single parsed declaration from an ::YARD::Parser::RBS file.
Each Statement may have a block of child statements for
namespace declarations (class, module, interface).
Class Method Summary
- .new(attrs = {}) ⇒ Statement constructor
Instance Attribute Summary
- #attr_rbs_type ⇒ String? readonly
- #block ⇒ Array<Statement> readonly
- #comments ⇒ String? readonly
- #comments_hash_flag ⇒ false readonly
- #comments_range ⇒ Range? readonly
- #line ⇒ Integer readonly
- #mixin_name ⇒ String? readonly
- #name ⇒ String readonly
- #signatures ⇒ Array<String> readonly
- #source ⇒ String readonly
- #superclass ⇒ String? readonly
- #type ⇒ Symbol readonly
- #visibility ⇒ Symbol? readonly
Instance Method Summary
Constructor Details
.new(attrs = {}) ⇒ Statement
# File 'lib/yard/parser/rbs/statement.rb', line 52
def initialize(attrs = {}) @type = attrs[:type] @name = attrs[:name] @superclass = attrs[:superclass] @line = attrs[:line] || 1 @source = attrs[:source] || '' @comments = attrs[:comments] @comments_range = attrs[:comments_range] @comments_hash_flag = false @block = attrs[:block] || [] @signatures = attrs[:signatures] || [] @mixin_name = attrs[:mixin_name] @attr_rbs_type = attrs[:attr_rbs_type] @visibility = attrs[:visibility] end
Instance Attribute Details
#attr_rbs_type ⇒ String? (readonly)
# File 'lib/yard/parser/rbs/statement.rb', line 47
attr_reader :attr_rbs_type
#block ⇒ Array<Statement> (readonly)
# File 'lib/yard/parser/rbs/statement.rb', line 37
attr_reader :block
#comments ⇒ String? (readonly)
# File 'lib/yard/parser/rbs/statement.rb', line 28
attr_reader :comments
#comments_hash_flag ⇒ false (readonly)
# File 'lib/yard/parser/rbs/statement.rb', line 34
attr_reader :comments_hash_flag
#comments_range ⇒ Range? (readonly)
# File 'lib/yard/parser/rbs/statement.rb', line 31
attr_reader :comments_range
#line ⇒ Integer (readonly)
# File 'lib/yard/parser/rbs/statement.rb', line 22
attr_reader :line
#mixin_name ⇒ String? (readonly)
# File 'lib/yard/parser/rbs/statement.rb', line 44
attr_reader :mixin_name
#name ⇒ String (readonly)
# File 'lib/yard/parser/rbs/statement.rb', line 16
attr_reader :name
#signatures ⇒ Array<String> (readonly)
# File 'lib/yard/parser/rbs/statement.rb', line 41
attr_reader :signatures
#source ⇒ String (readonly)
# File 'lib/yard/parser/rbs/statement.rb', line 25
attr_reader :source
#superclass ⇒ String? (readonly)
# File 'lib/yard/parser/rbs/statement.rb', line 19
attr_reader :superclass
#type ⇒ Symbol (readonly)
# File 'lib/yard/parser/rbs/statement.rb', line 13
attr_reader :type
#visibility ⇒ Symbol? (readonly)
# File 'lib/yard/parser/rbs/statement.rb', line 50
attr_reader :visibility
Instance Method Details
#show ⇒ String
# File 'lib/yard/parser/rbs/statement.rb', line 69
def show source end