Exception: NeedsResources::MissingResourceError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/needs_resources/missing_resource_error.rb

Instance Method Summary collapse

Constructor Details

#initialize(*names) ⇒ MissingResourceError

Returns a new instance of MissingResourceError.



4
5
6
7
8
9
10
# File 'lib/needs_resources/missing_resource_error.rb', line 4

def initialize(*names)
  if names.size == 1
    super "The following resources is missing: #{names.first}."
  else
    super "The following resources are missing: #{names.to_sentence}."
  end
end