Exception: SmartProperties::ConstructorArgumentForwardingError

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

Instance Method Summary collapse

Constructor Details

#initialize(positional_arguments, keyword_arguments) ⇒ ConstructorArgumentForwardingError

Returns a new instance of ConstructorArgumentForwardingError.



17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/smart_properties/errors.rb', line 17

def initialize(positional_arguments, keyword_arguments)
  argument_description = [
    generate_description("positional", positional_arguments.count),
    generate_description("keyword", keyword_arguments.count)
  ].compact

  arguments = positional_arguments + keyword_arguments.map { |name, value| "#{name}: #{value}" }

  super "Forwarding the following %s failed: %s" % [
    argument_description.join(" and "),
    arguments.join(", ")
  ]
end