Sha256: 1a97c213223dedb493875e7badfad31b552c32fe43d49cee4e057f8076cd03dd

Contents?: true

Size: 620 Bytes

Versions: 19

Compression:

Stored size: 620 Bytes

Contents

module Lutaml
  module Model
    class CollectionCountOutOfRangeError < Error
      def initialize(attr_name, value, range)
        @attr_name = attr_name
        @value = value
        @range = range

        super()
      end

      def to_s
        "#{@attr_name} count is #{@value.size}, must be #{range_to_string}"
      end

      private

      def range_to_string
        if @range.end.nil?
          "at least #{@range.begin}"
        elsif @range.begin == @range.end
          "exactly #{@range.begin}"
        else
          "between #{@range.begin} and #{@range.end}"
        end
      end
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
lutaml-model-0.3.28 lib/lutaml/model/error/collection_count_out_of_range_error.rb
lutaml-model-0.3.27 lib/lutaml/model/error/collection_count_out_of_range_error.rb
lutaml-model-0.3.26 lib/lutaml/model/error/collection_count_out_of_range_error.rb
lutaml-model-0.3.25 lib/lutaml/model/error/collection_count_out_of_range_error.rb
lutaml-model-0.3.24 lib/lutaml/model/error/collection_count_out_of_range_error.rb
lutaml-model-0.3.23 lib/lutaml/model/error/collection_count_out_of_range_error.rb
lutaml-model-0.3.22 lib/lutaml/model/error/collection_count_out_of_range_error.rb
lutaml-model-0.3.21 lib/lutaml/model/error/collection_count_out_of_range_error.rb
lutaml-model-0.3.20 lib/lutaml/model/error/collection_count_out_of_range_error.rb
lutaml-model-0.3.19 lib/lutaml/model/error/collection_count_out_of_range_error.rb
lutaml-model-0.3.18 lib/lutaml/model/error/collection_count_out_of_range_error.rb
lutaml-model-0.3.17 lib/lutaml/model/error/collection_count_out_of_range_error.rb
lutaml-model-0.3.16 lib/lutaml/model/error/collection_count_out_of_range_error.rb
lutaml-model-0.3.15 lib/lutaml/model/error/collection_count_out_of_range_error.rb
lutaml-model-0.3.14 lib/lutaml/model/error/collection_count_out_of_range_error.rb
lutaml-model-0.3.13 lib/lutaml/model/error/collection_count_out_of_range_error.rb
lutaml-model-0.3.12 lib/lutaml/model/error/collection_count_out_of_range_error.rb
lutaml-model-0.3.11 lib/lutaml/model/error/collection_count_out_of_range_error.rb
lutaml-model-0.3.10 lib/lutaml/model/error/collection_count_out_of_range_error.rb