Sha256: 3e76c009c71538ba90c9baf00ff274df4205fd5e6250a58748d562e38a3907a4

Contents?: true

Size: 701 Bytes

Versions: 7

Compression:

Stored size: 701 Bytes

Contents

# typed: false

module Mangadex
  module Internal
    module Definitions
      class ContentRating < Base
        def initialize(value)
          super(
            value,
            key: :content_rating,
            accepts: Accepts.new(
              array: Mangadex::ContentRating::VALUES,
              class: Mangadex::ContentRating,
              condition: :or,
            ),
            converts: :to_s,
            required: false,
          )
        end

        def validate_accepts
          @accepts.validate!(converted_value)
        rescue ArgumentError => error
          add_error(error.message)
        end

        def validate_condition

        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
mangadex-5.10.0 lib/mangadex/internal/definitions/content_rating.rb
mangadex-5.9.0 lib/mangadex/internal/definitions/content_rating.rb
mangadex-5.8.0 lib/mangadex/internal/definitions/content_rating.rb
mangadex-5.7.5.3 lib/mangadex/internal/definitions/content_rating.rb
mangadex-5.7.5.2 lib/mangadex/internal/definitions/content_rating.rb
mangadex-5.7.5.1 lib/mangadex/internal/definitions/content_rating.rb
mangadex-5.7.5 lib/mangadex/internal/definitions/content_rating.rb