Exception: MediaTypes::Serialization::UnbackedAliasDefinitionError

Inherits:
ConfigurationError show all
Defined in:
lib/media_types/serialization/error.rb

Instance Method Summary collapse

Constructor Details

#initialize(identifier, inout) ⇒ UnbackedAliasDefinitionError

Returns a new instance of UnbackedAliasDefinitionError.



73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/media_types/serialization/error.rb', line 73

def initialize(identifier, inout)
  super(
      "Serializer tried to define an #{inout}_alias that points to the media type identifier #{identifier} but no such #{inout} has been defined yet. Please move the #{inout} definition above the alias.\n\n" \
      "Move the #{inout} definition above the alias:\n" \
      "\n" \
      "class MySerializer < MediaTypes::Serialization::Base\n" \
      "#...\n" \
      "#{inout} do\n" \
      "  # ...\n" \
      "end\n" \
      "\n" \
      "#{inout}_alias 'text/html'\n" \
      "# ^----- move here\n" \
      'end'
  )
end