Class: Lutaml::Model::MixedContentCollectionError

Inherits:
Error
  • Object
show all
Defined in:
lib/lutaml/model/error/mixed_content_collection_error.rb

Instance Method Summary collapse

Constructor Details

#initialize(attr_name, model_class) ⇒ MixedContentCollectionError

Returns a new instance of MixedContentCollectionError.



4
5
6
7
8
9
# File 'lib/lutaml/model/error/mixed_content_collection_error.rb', line 4

def initialize(attr_name, model_class)
  @attr_name = attr_name
  @model_class = model_class

  super()
end

Instance Method Details

#to_sObject



11
12
13
14
# File 'lib/lutaml/model/error/mixed_content_collection_error.rb', line 11

def to_s
  "Mixed content requires `#{@attr_name}` to be a string collection in #{@model_class}. " \
    "Use `attribute :#{@attr_name}, :string, collection: true` when `mixed_content` is enabled."
end