Exception: StubRequests::PropertyDefined

Inherits:
Error
  • Object
show all
Defined in:
lib/stub_requests/exceptions.rb

Overview

PropertyDefined is raised when trying to add the same property twice

Since:

  • 0.1.0

Instance Method Summary collapse

Constructor Details

#initialize(name:, type:, default:) ⇒ PropertyDefined

Returns a new instance of PropertyDefined

Since:

  • 0.1.0



79
80
81
82
# File 'lib/stub_requests/exceptions.rb', line 79

def initialize(name:, type:, default:)
  default = "nil" if default.is_a?(NilClass)
  super("Property ##{name} was already defined as `{ type: #{type}, default: #{default} }")
end