Exception: TransferConstraintError

Inherits:
StandardError
  • Object
show all
Defined in:
backend/app/lib/exceptions.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(conflicts = {}) ⇒ TransferConstraintError

Returns a new instance of TransferConstraintError.



57
58
59
# File 'backend/app/lib/exceptions.rb', line 57

def initialize(conflicts = {})
  @conflicts = conflicts
end

Instance Attribute Details

#conflictsObject

Returns the value of attribute conflicts



55
56
57
# File 'backend/app/lib/exceptions.rb', line 55

def conflicts
  @conflicts
end

Instance Method Details

#add_conflict(uri, property) ⇒ Object



61
62
63
64
65
66
67
68
# File 'backend/app/lib/exceptions.rb', line 61

def add_conflict(uri, property)
  if property.is_a? Hash
    @conflicts[uri] ||= []
    @conflicts[uri] << property
  else
    @conflicts[uri] = property
  end
end

#to_sObject



70
71
72
# File 'backend/app/lib/exceptions.rb', line 70

def to_s
  "#<#{self.class}: #{@conflicts.inspect}>"
end