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

Inherits:
Object
  • Object
show all
Defined in:
embulk-core/src/main/ruby/embulk/guess/time_format_guess.rb

Instance Method Summary collapse

Constructor Details

#initialize(regexp, format) ⇒ RegexpPattern

Returns a new instance of RegexpPattern



363
364
365
366
# File 'embulk-core/src/main/ruby/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 'embulk-core/src/main/ruby/embulk/guess/time_format_guess.rb', line 368

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