Class: Source2MD::RegexpBuilder
- Inherits:
-
Object
- Object
- Source2MD::RegexpBuilder
- Defined in:
- lib/source2md/regexp_builder.rb
Instance Attribute Summary collapse
-
#comment_re ⇒ Object
Returns the value of attribute comment_re.
-
#prefix_re ⇒ Object
Returns the value of attribute prefix_re.
Instance Method Summary collapse
-
#initialize ⇒ RegexpBuilder
constructor
A new instance of RegexpBuilder.
- #meta_re ⇒ Object
- #stdout_re ⇒ Object
- #update {|_self| ... } ⇒ Object
Constructor Details
#initialize ⇒ RegexpBuilder
Returns a new instance of RegexpBuilder.
6 7 8 9 10 11 |
# File 'lib/source2md/regexp_builder.rb', line 6 def initialize update do |e| e.prefix_re = %r{^\s*} e.comment_re = %r{#|//} end end |
Instance Attribute Details
#comment_re ⇒ Object
Returns the value of attribute comment_re.
4 5 6 |
# File 'lib/source2md/regexp_builder.rb', line 4 def comment_re @comment_re end |
#prefix_re ⇒ Object
Returns the value of attribute prefix_re.
3 4 5 |
# File 'lib/source2md/regexp_builder.rb', line 3 def prefix_re @prefix_re end |
Instance Method Details
#meta_re ⇒ Object
18 19 20 |
# File 'lib/source2md/regexp_builder.rb', line 18 def @meta_re ||= %r{#{prefix_re}(?:#{comment_re})} end |
#stdout_re ⇒ Object
22 23 24 |
# File 'lib/source2md/regexp_builder.rb', line 22 def stdout_re @stdout_re ||= %r{^(?:#{comment_re}) >>.*$} end |
#update {|_self| ... } ⇒ Object
13 14 15 16 |
# File 'lib/source2md/regexp_builder.rb', line 13 def update(&block) yield self reset end |