Class: FileCrawler::Regex
- Inherits:
-
Object
- Object
- FileCrawler::Regex
- Defined in:
- lib/file_crawler/finder/command/collect.rb
Instance Attribute Summary collapse
-
#regexp_end ⇒ Object
Returns the value of attribute regexp_end.
-
#regexp_start ⇒ Object
Returns the value of attribute regexp_start.
Instance Method Summary collapse
-
#initialize(regexp_start, regexp_end) ⇒ Regex
constructor
A new instance of Regex.
- #pattern ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(regexp_start, regexp_end) ⇒ Regex
Returns a new instance of Regex.
6 7 8 9 |
# File 'lib/file_crawler/finder/command/collect.rb', line 6 def initialize(regexp_start, regexp_end) @regexp_start = regexp_start @regexp_end = regexp_end end |
Instance Attribute Details
#regexp_end ⇒ Object
Returns the value of attribute regexp_end.
4 5 6 |
# File 'lib/file_crawler/finder/command/collect.rb', line 4 def regexp_end @regexp_end end |
#regexp_start ⇒ Object
Returns the value of attribute regexp_start.
4 5 6 |
# File 'lib/file_crawler/finder/command/collect.rb', line 4 def regexp_start @regexp_start end |
Instance Method Details
#pattern ⇒ Object
11 12 13 |
# File 'lib/file_crawler/finder/command/collect.rb', line 11 def pattern /#{Regexp.escape(regexp_start)}([^#{Regexp.escape(regexp_end)}]+)#{Regexp.escape(regexp_end)}/ end |
#to_s ⇒ Object
15 16 17 |
# File 'lib/file_crawler/finder/command/collect.rb', line 15 def to_s "#<#{self.class.name}: start='#{regexp_start}', end='#{regexp_end}'" end |