Class: DocRSpec::Parser
- Inherits:
-
Object
- Object
- DocRSpec::Parser
- Defined in:
- lib/doc_rspec/parser.rb
Defined Under Namespace
Classes: InternalError, SyntaxError
Constant Summary collapse
- CONTEXT_DEFINITION =
%r{\A \s* \# \s ={1,7} \s (.*)}x
- EQUALS_OP =
%r{\s+ => \s+}x
- EXAMPLE_LINE =
%r{\A \s* \# \s{4,} (.*)}x
- START_EXAMPLE =
%r{\A \s* \# \s{4,} \# \s example: \s (.*)}x
Instance Attribute Summary collapse
-
#ast ⇒ Object
readonly
Returns the value of attribute ast.
-
#lines ⇒ Object
readonly
Returns the value of attribute lines.
-
#state ⇒ Object
readonly
Returns the value of attribute state.
Instance Method Summary collapse
Instance Attribute Details
#ast ⇒ Object (readonly)
Returns the value of attribute ast.
18 19 20 |
# File 'lib/doc_rspec/parser.rb', line 18 def ast @ast end |
#lines ⇒ Object (readonly)
Returns the value of attribute lines.
18 19 20 |
# File 'lib/doc_rspec/parser.rb', line 18 def lines @lines end |
#state ⇒ Object (readonly)
Returns the value of attribute state.
18 19 20 |
# File 'lib/doc_rspec/parser.rb', line 18 def state @state end |
Instance Method Details
#parse ⇒ Object
20 21 22 23 24 25 |
# File 'lib/doc_rspec/parser.rb', line 20 def parse lines.each_with_index do |line, lnb| parse_line(line, lnb.succ) end ast.reject(&:empty?) end |