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.



169
170
171
172
# File 'lib/view_model/deserialization_error.rb', line 169

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.



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

def expected_type
  @expected_type
end

Instance Method Details

#detailObject



174
175
176
# File 'lib/view_model/deserialization_error.rb', line 174

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

#metaObject



178
179
180
# File 'lib/view_model/deserialization_error.rb', line 178

def meta
  super.merge(expected_type: expected_type)
end