Exception: ViewModel::DeserializationError::InvalidViewType

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(expected_type, node) ⇒ InvalidViewType

Returns a new instance of InvalidViewType.



167
168
169
170
# File 'lib/view_model/deserialization_error.rb', line 167

def initialize(expected_type, node)
  @expected_type = expected_type
  super(node)
end

Instance Attribute Details

#expected_typeObject (readonly)

Returns the value of attribute expected_type.



165
166
167
# File 'lib/view_model/deserialization_error.rb', line 165

def expected_type
  @expected_type
end

Instance Method Details

#detailObject



172
173
174
# File 'lib/view_model/deserialization_error.rb', line 172

def detail
  "Cannot deserialize inappropriate view type, expected '#{expected_type}' or an alias"
end

#metaObject



176
177
178
# File 'lib/view_model/deserialization_error.rb', line 176

def meta
  super.merge(expected_type: expected_type)
end