Class: Embulk::Guess::TimeFormatGuess::RegexpPattern

Inherits:
Object
  • Object
show all
Defined in:
lib/embulk/guess/time_format_guess.rb

Instance Method Summary collapse

Constructor Details

#initialize(regexp, format) ⇒ RegexpPattern

Returns a new instance of RegexpPattern.



347
348
349
350
# File 'lib/embulk/guess/time_format_guess.rb', line 347

def initialize(regexp, format)
  @regexp = regexp
  @match = SimpleMatch.new(format)
end

Instance Method Details

#match(text) ⇒ Object



352
353
354
355
356
357
358
# File 'lib/embulk/guess/time_format_guess.rb', line 352

def match(text)
  if @regexp =~ text
    return @match
  else
    return nil
  end
end