Exception: ViewModel::DeserializationError::DuplicateNodes

Inherits:
InvalidRequest show all
Defined in:
lib/view_model/deserialization_error.rb

Instance Attribute Summary collapse

Attributes inherited from AbstractErrorWithBlame

#nodes

Instance Method Summary collapse

Methods inherited from ViewModel::DeserializationError

#code

Methods inherited from AbstractError

#aggregation?, #causes, #code, #exception, #status, #title, #to_s, #view

Constructor Details

#initialize(type, nodes) ⇒ DuplicateNodes

Returns a new instance of DuplicateNodes.



234
235
236
237
# File 'lib/view_model/deserialization_error.rb', line 234

def initialize(type, nodes)
  @type = type
  super(nodes)
end

Instance Attribute Details

#typeObject (readonly)

Returns the value of attribute type.



232
233
234
# File 'lib/view_model/deserialization_error.rb', line 232

def type
  @type
end

Instance Method Details

#detailObject



239
240
241
# File 'lib/view_model/deserialization_error.rb', line 239

def detail
  "Duplicate views for the same '#{type}' specified: " + nodes.map(&:to_s).join(', ')
end

#metaObject



243
244
245
# File 'lib/view_model/deserialization_error.rb', line 243

def meta
  super.merge(type: type)
end