Class: DocGen::Spec
- Inherits:
-
Struct
- Object
- Struct
- DocGen::Spec
- Defined in:
- lib/doc_gen/parser.rb
Overview
A spec represents an ‘it` or `specify` block.
Instance Attribute Summary collapse
-
#docstring ⇒ Object
Returns the value of attribute docstring.
-
#file ⇒ Object
Returns the value of attribute file.
-
#line ⇒ Object
Returns the value of attribute line.
-
#name ⇒ Object
Returns the value of attribute name.
-
#parent ⇒ Object
Returns the value of attribute parent.
-
#source ⇒ Object
Returns the value of attribute source.
Instance Method Summary collapse
-
#full_name ⇒ Object
Full display name including ancestors (root component dropped, same as Context).
Instance Attribute Details
#docstring ⇒ Object
Returns the value of attribute docstring
59 60 61 |
# File 'lib/doc_gen/parser.rb', line 59 def docstring @docstring end |
#file ⇒ Object
Returns the value of attribute file
59 60 61 |
# File 'lib/doc_gen/parser.rb', line 59 def file @file end |
#line ⇒ Object
Returns the value of attribute line
59 60 61 |
# File 'lib/doc_gen/parser.rb', line 59 def line @line end |
#name ⇒ Object
Returns the value of attribute name
59 60 61 |
# File 'lib/doc_gen/parser.rb', line 59 def name @name end |
#parent ⇒ Object
Returns the value of attribute parent
59 60 61 |
# File 'lib/doc_gen/parser.rb', line 59 def parent @parent end |
#source ⇒ Object
Returns the value of attribute source
59 60 61 |
# File 'lib/doc_gen/parser.rb', line 59 def source @source end |
Instance Method Details
#full_name ⇒ Object
Full display name including ancestors (root component dropped, same as Context).
61 62 63 64 65 66 67 68 69 70 |
# File 'lib/doc_gen/parser.rb', line 61 def full_name parts = [name] ctx = parent while ctx.is_a?(Context) parts.unshift(ctx.name) ctx = ctx.parent end parts.shift if parts.size > 1 parts.join(' ') end |