Class: Mangadex::Author

Inherits:
MangadexObject show all
Defined in:
lib/mangadex/author.rb

Direct Known Subclasses

Artist

Instance Attribute Summary

Attributes included from Internal::WithAttributes

#attributes, #id, #relationships, #type

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from MangadexObject

attributes_to_inspect, #eq?, #hash, #initialize, #inspect

Constructor Details

This class inherits a constructor from Mangadex::MangadexObject

Class Method Details

.create(**args) ⇒ Object



35
36
37
38
39
40
41
42
43
# File 'lib/mangadex/author.rb', line 35

def self.create(**args)
  Mangadex::Internal::Request.post(
    '/author',
    payload: Mangadex::Internal::Definition.validate(args, {
      name: { accepts: String, required: true },
      version: { accepts: Integer },
    })
  )
end

.delete(id) ⇒ Object



83
84
85
86
87
# File 'lib/mangadex/author.rb', line 83

def self.delete(id)
  Mangadex::Internal::Request.delete(
    format('/author/%{id}', id: id)
  )
end

.get(id, **args) ⇒ Object



51
52
53
54
55
56
57
58
# File 'lib/mangadex/author.rb', line 51

def self.get(id, **args)
  Mangadex::Internal::Request.get(
    format('/author/%{id}', id: id),
    Mangadex::Internal::Definition.validate(args, {
      includes: { accepts: [String] },
    })
  )
end

.inspect_attributesObject



89
90
91
# File 'lib/mangadex/author.rb', line 89

def self.inspect_attributes
  [:name]
end

.list(**args) ⇒ Object



15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/mangadex/author.rb', line 15

def self.list(**args)
  Mangadex::Internal::Request.get(
    '/author',
    Mangadex::Internal::Definition.validate(args, {
      limit: { accepts: Integer },
      offset: { accepts: Integer },
      ids: { accepts: [String] },
      name: { accepts: String },
      order: { accepts: Hash },
      includes: { accepts: [String] },
    })
  )
end

.update(id, **args) ⇒ Object



66
67
68
69
70
71
72
73
74
# File 'lib/mangadex/author.rb', line 66

def self.update(id, **args)
  Mangadex::Internal::Request.put(
    format('/author/%{id}', id: id),
    payload: Mangadex::Internal::Definition.validate(args, {
      name: { accepts: String },
      version: { accepts: Integer, required: true },
    })
  )
end

Instance Method Details

#artist?Boolean

Returns:

  • (Boolean)


97
98
99
# File 'lib/mangadex/author.rb', line 97

def artist?
  false
end