Exception: I18nliner::ExtractionError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/i18nliner/errors.rb

Instance Method Summary collapse

Constructor Details

#initialize(line, detail = nil) ⇒ ExtractionError

Returns a new instance of ExtractionError.



3
4
5
6
# File 'lib/i18nliner/errors.rb', line 3

def initialize(line, detail = nil)
  @line = line
  @detail = detail
end

Instance Method Details

#to_sObject



8
9
10
11
12
13
14
15
# File 'lib/i18nliner/errors.rb', line 8

def to_s
  error = self.class.name.underscore.humanize
  error.gsub!(/\AI18nliner\/| error\z/, '')
  error = "#{error} on line #{@line}"
  @detail ?
    error + " (got #{@detail.inspect})" :
    error
end