Class: Embulk::TimeFormatGuess::RegexpPattern

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

Instance Method Summary collapse

Constructor Details

#initialize(regexp, format) ⇒ RegexpPattern

Returns a new instance of RegexpPattern.



283
284
285
286
# File 'lib/embulk/time_format_guess.rb', line 283

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

Instance Method Details

#match(text) ⇒ Object



288
289
290
291
292
293
294
# File 'lib/embulk/time_format_guess.rb', line 288

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