Sha256: 9d81a51edad4fbfd48ac9c555f89ad61f4129b815cf4218c3cdcbec87fd5f673

Contents?: true

Size: 612 Bytes

Versions: 2

Compression:

Stored size: 612 Bytes

Contents

module Mangadex
  class Thread < MangadexObject
    has_attributes \
      :replies_count

    class << self
      def create(type:, id:)
        payload = {type: type, id: id}
        Mangadex::Internal::Request.post(
          '/forums/thread',
          payload: Mangadex::Internal::Definition.validate(payload, {
            type: { accepts: %w(manga group chapter), converts: :to_s, required: true },
            id: { accepts: String, required: true },
          }),
          auth: true,
        )
      end
    end

    def self.attributes_to_inspect
      [:id, :type, :replies_count]
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
mangadex-5.10.0 lib/mangadex/thread.rb
mangadex-5.9.0 lib/mangadex/thread.rb