Class: Embulk::Guess::TimeFormatGuess::RegexpPattern
- Inherits:
-
Object
- Object
- Embulk::Guess::TimeFormatGuess::RegexpPattern
- Defined in:
- lib/embulk/guess/time_format_guess.rb
Instance Method Summary collapse
-
#initialize(regexp, format) ⇒ RegexpPattern
constructor
A new instance of RegexpPattern.
- #match(text) ⇒ Object
Constructor Details
#initialize(regexp, format) ⇒ RegexpPattern
Returns a new instance of RegexpPattern.
363 364 365 366 |
# File 'lib/embulk/guess/time_format_guess.rb', line 363 def initialize(regexp, format) @regexp = regexp @match = SimpleMatch.new(format) end |
Instance Method Details
#match(text) ⇒ Object
368 369 370 371 372 373 374 |
# File 'lib/embulk/guess/time_format_guess.rb', line 368 def match(text) if @regexp =~ text return @match else return nil end end |