lib/mangadex/chapter.rb in mangadex-5.3.2 vs lib/mangadex/chapter.rb in mangadex-5.3.3

- old
+ new

@@ -29,20 +29,24 @@ ) end sig { params(id: String, args: T::Api::Arguments).returns(Mangadex::Api::Response[Chapter]) } def self.get(id, **args) + Mangadex::Internal::Definition.must(id) + Mangadex::Internal::Request.get( '/chapter/%{id}' % {id: id}, Mangadex::Internal::Definition.validate(args, { includes: { accepts: [String] }, }), ) end sig { params(id: String, args: T::Api::Arguments).returns(Mangadex::Api::Response[Chapter]) } def self.update(id, **args) + Mangadex::Internal::Definition.must(id) + Mangadex::Internal::Request.put( '/chapter/%{id}' % {id: id}, payload: Mangadex::Internal::Definition.validate(args, { title: { accepts: String }, volume: { accepts: String }, @@ -54,12 +58,18 @@ ) end sig { params(id: String).returns(Hash) } def self.delete(id) + Mangadex::Internal::Definition.must(id) + Mangadex::Internal::Request.delete( '/chapter/%{id}' % {id: id}, ) + end + + class << self + alias_method :view, :get end sig { returns(String) } def title attributes&.title.presence || chapter.presence && "Chapter #{chapter}" || "N/A"