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.



349
350
351
352
# File 'lib/embulk/guess/time_format_guess.rb', line 349

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

Instance Method Details

#match(text) ⇒ Object



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

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