Class: YARD::Parser::C::Statement
- Inherits:
-
Object
- Object
- YARD::Parser::C::Statement
- Defined in:
- lib/yard/parser/c/statement.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#comments_hash_flag ⇒ Object
Returns the value of attribute comments_hash_flag.
-
#file ⇒ Object
Returns the value of attribute file.
-
#group ⇒ Object
deprecated
Deprecated.
Groups are now defined by directives
-
#line ⇒ Object
Returns the value of attribute line.
-
#source ⇒ Object
Returns the value of attribute source.
Instance Method Summary collapse
- #comments_range ⇒ Object
- #first_line ⇒ Object
-
#initialize(source, file = nil, line = nil) ⇒ Statement
constructor
A new instance of Statement.
- #line_range ⇒ Object
- #show ⇒ Object
Constructor Details
#initialize(source, file = nil, line = nil) ⇒ Statement
Returns a new instance of Statement.
15 16 17 18 19 |
# File 'lib/yard/parser/c/statement.rb', line 15 def initialize(source, file = nil, line = nil) @source = source @file = file @line = line end |
Instance Attribute Details
#comments_hash_flag ⇒ Object
Returns the value of attribute comments_hash_flag.
13 14 15 |
# File 'lib/yard/parser/c/statement.rb', line 13 def comments_hash_flag @comments_hash_flag end |
#file ⇒ Object
Returns the value of attribute file.
7 8 9 |
# File 'lib/yard/parser/c/statement.rb', line 7 def file @file end |
#group ⇒ Object
Deprecated.
Groups are now defined by directives
11 12 13 |
# File 'lib/yard/parser/c/statement.rb', line 11 def group @group end |
#line ⇒ Object
Returns the value of attribute line.
6 7 8 |
# File 'lib/yard/parser/c/statement.rb', line 6 def line @line end |
#source ⇒ Object
Returns the value of attribute source.
5 6 7 |
# File 'lib/yard/parser/c/statement.rb', line 5 def source @source end |
Instance Method Details
#comments_range ⇒ Object
25 26 27 |
# File 'lib/yard/parser/c/statement.rb', line 25 def comments_range comments.line_range end |
#first_line ⇒ Object
29 30 31 |
# File 'lib/yard/parser/c/statement.rb', line 29 def first_line source.split(/\n/).first end |
#line_range ⇒ Object
21 22 23 |
# File 'lib/yard/parser/c/statement.rb', line 21 def line_range line...(line + source.count("\n")) end |
#show ⇒ Object
33 34 35 |
# File 'lib/yard/parser/c/statement.rb', line 33 def show "\t#{line}: #{first_line}" end |