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
Methods included from Concern
#append_features, #class_methods, extended, #included, #prepend_features, #prepended
Class Method Details
.create(**args) ⇒ Object
54
55
56
57
58
59
60
61
62
|
# File 'lib/mangadex/author.rb', line 54
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
106
107
108
109
110
111
112
|
# File 'lib/mangadex/author.rb', line 106
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
70
71
72
73
74
75
76
77
78
79
|
# File 'lib/mangadex/author.rb', line 70
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], converts: :to_a },
})
)
end
|
.inspect_attributes ⇒ Object
114
115
116
|
# File 'lib/mangadex/author.rb', line 114
def self.inspect_attributes
[:name]
end
|
.list(**args) ⇒ Object
34
35
36
37
38
39
40
41
42
43
44
45
46
|
# File 'lib/mangadex/author.rb', line 34
def self.list(**args)
Mangadex::Internal::Request.get(
'/author',
Mangadex::Internal::Definition.validate(args, {
limit: { accepts: Integer, converts: :to_i },
offset: { accepts: Integer, converts: :to_i },
ids: { accepts: [String], converts: :to_a },
name: { accepts: String },
order: { accepts: Hash },
includes: { accepts: [String], converts: :to_a },
})
)
end
|
.update(id, **args) ⇒ Object
87
88
89
90
91
92
93
94
95
96
97
|
# File 'lib/mangadex/author.rb', line 87
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
126
127
128
|
# File 'lib/mangadex/author.rb', line 126
def artist?
false
end
|