lib/mangadex/author.rb in mangadex-5.3.2 vs lib/mangadex/author.rb in mangadex-5.3.3
- old
+ new
@@ -64,10 +64,12 @@
# Reference: https://api.mangadex.org/docs.html#operation/get-author-id
#
# @return [Mangadex::Api::Response] with a entity of author
sig { params(id: String, args: T::Api::Arguments).returns(Mangadex::Api::Response[Author]) }
def self.get(id, **args)
+ Mangadex::Internal::Definition.must(id)
+
Mangadex::Internal::Request.get(
format('/author/%{id}', id: id),
Mangadex::Internal::Definition.validate(args, {
includes: { accepts: [String] },
})
@@ -79,10 +81,12 @@
# Reference: https://api.mangadex.org/docs.html#operation/put-author-id
#
# @return [Mangadex::Api::Response] with a entity of author
sig { params(id: String, args: T::Api::Arguments).returns(Mangadex::Api::Response[Author]) }
def self.update(id, **args)
+ Mangadex::Internal::Definition.must(id)
+
Mangadex::Internal::Request.put(
format('/author/%{id}', id: id),
payload: Mangadex::Internal::Definition.validate(args, {
name: { accepts: String },
version: { accepts: Integer, required: true },
@@ -96,16 +100,22 @@
#
# @param id Author's ID
# @return [Hash]
sig { params(id: String).returns(Hash) }
def self.delete(id)
+ Mangadex::Internal::Definition.must(id)
+
Mangadex::Internal::Request.delete(
format('/author/%{id}', id: id)
)
end
def self.inspect_attributes
[:name]
+ end
+
+ class << self
+ alias_method :view, :get
end
# Indicates if this is an artist
#
# @return [Boolean] whether this is an artist or not.