Exception: PriceHubble::EntityInvalid

Inherits:
EntityError
  • Object
show all
Defined in:
lib/pricehubble/errors.rb

Overview

Raised when the record is invalid, due to a response.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message = nil, entity = nil) ⇒ EntityInvalid

Create a new instance of the error.

Parameters:

  • message (String) (defaults to: nil)

    the error message

  • entity (PriceHubble::BaseEntity) (defaults to: nil)

    the entity which was invalid



53
54
55
56
57
58
# File 'lib/pricehubble/errors.rb', line 53

def initialize(message = nil, entity = nil)
  @entity = entity
  message ||= "Invalid #{entity}"

  super(message)
end

Instance Attribute Details

#entityObject (readonly)

Returns the value of attribute entity.



47
48
49
# File 'lib/pricehubble/errors.rb', line 47

def entity
  @entity
end