Class: Frenetic::ConfigError

Inherits:
Error
  • Object
show all
Defined in:
lib/frenetic/errors.rb

Overview

Raised when there is a configuration error

Direct Known Subclasses

MissingDependency

Instance Method Summary collapse

Constructor Details

#initialize(model) ⇒ ConfigError

Returns a new instance of ConfigError.



10
11
12
13
# File 'lib/frenetic/errors.rb', line 10

def initialize(model)
  @model = model
  super(message)
end

Instance Method Details

#messageObject



15
16
17
18
19
20
21
22
23
24
# File 'lib/frenetic/errors.rb', line 15

def message
  if @model.is_a? String
    @model
  else
    errs = @model.errors.collect do |key, msg|
      "#{key.to_s.titleize} #{msg}"
    end
    "Invalid Configuration: #{errs.to_sentence}"
  end
end