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)
-
- (Object) comments_hash_flag
Returns the value of attribute comments_hash_flag.
-
- (Object) file
Returns the value of attribute file.
-
- (Object) group
deprecated
Deprecated.
Groups are now defined by directives
-
- (Object) line
Returns the value of attribute line.
-
- (Object) source
Returns the value of attribute source.
Instance Method Summary (collapse)
- - (Object) comments_range
- - (Object) first_line
-
- (Statement) initialize(source, file = nil, line = nil)
constructor
A new instance of Statement.
- - (Object) line_range
- - (Object) show
Constructor Details
- (Statement) initialize(source, file = nil, line = nil)
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
- (Object) comments_hash_flag
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 |
- (Object) file
Returns the value of attribute file
7 8 9 |
# File 'lib/yard/parser/c/statement.rb', line 7 def file @file end |
- (Object) group
Deprecated.
Groups are now defined by directives
11 12 13 |
# File 'lib/yard/parser/c/statement.rb', line 11 def group @group end |
- (Object) line
Returns the value of attribute line
6 7 8 |
# File 'lib/yard/parser/c/statement.rb', line 6 def line @line end |
- (Object) source
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
- (Object) comments_range
25 26 27 |
# File 'lib/yard/parser/c/statement.rb', line 25 def comments_range comments.line_range end |
- (Object) first_line
29 30 31 |
# File 'lib/yard/parser/c/statement.rb', line 29 def first_line source.split(/\n/).first end |
- (Object) line_range
21 22 23 |
# File 'lib/yard/parser/c/statement.rb', line 21 def line_range line...(line + source.count("\n")) end |
- (Object) show
33 34 35 |
# File 'lib/yard/parser/c/statement.rb', line 33 def show "\t#{line}: #{first_line}" end |