Class: Mangadex::Author
Instance Attribute Summary
#attributes, #id, #related_type, #relationships, #type
Class Method Summary
collapse
Instance Method Summary
collapse
attributes_to_inspect, #eq?, #hash, #initialize, #inspect
Class Method Details
.create(**args) ⇒ Object
52
53
54
55
56
57
58
59
60
|
# File 'lib/mangadex/author.rb', line 52
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
104
105
106
107
108
109
110
|
# File 'lib/mangadex/author.rb', line 104
def self.delete(id)
Mangadex::Internal::Definition.must(id)
Mangadex::Internal::Request.delete(
format('/author/%{id}', id: id)
)
end
|
.get(id, **args) ⇒ Object
Also known as:
view
68
69
70
71
72
73
74
75
76
77
|
# File 'lib/mangadex/author.rb', line 68
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] },
})
)
end
|
.inspect_attributes ⇒ Object
112
113
114
|
# File 'lib/mangadex/author.rb', line 112
def self.inspect_attributes
[:name]
end
|
.list(**args) ⇒ Object
32
33
34
35
36
37
38
39
40
41
42
43
44
|
# File 'lib/mangadex/author.rb', line 32
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
85
86
87
88
89
90
91
92
93
94
95
|
# File 'lib/mangadex/author.rb', line 85
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 },
})
)
end
|
Instance Method Details
#artist? ⇒ Boolean
124
125
126
|
# File 'lib/mangadex/author.rb', line 124
def artist?
false
end
|