Class: Mangadex::ScanlationGroup
Instance Attribute Summary
#attributes, #id, #related_type, #relationships, #type
Class 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
|
# File 'lib/mangadex/scanlation_group.rb', line 39
def create(**args)
Mangadex::Internal::Request.post(
'/group',
payload: Mangadex::Internal::Definition.validate(args, {
name: { accepts: String, required: true },
website: { accepts: String },
irc_server: { accepts: String },
irc_channel: { accepts: String },
discord: { accepts: String },
contact_email: { accepts: String },
description: { accepts: String },
}),
)
end
|
.follow(id) ⇒ Object
88
89
90
91
92
|
# File 'lib/mangadex/scanlation_group.rb', line 88
def follow(id)
Mangadex::Internal::Request.post(
'/group/%{id}/follow' % {id: id},
)
end
|
.inspect_attributes ⇒ Object
106
107
108
|
# File 'lib/mangadex/scanlation_group.rb', line 106
def self.inspect_attributes
self.attributes - [:version, :created_at, :updated_at]
end
|
.unfollow(id) ⇒ Object
94
95
96
97
98
|
# File 'lib/mangadex/scanlation_group.rb', line 94
def unfollow(id)
Mangadex::Internal::Request.delete(
'/group/%{id}/follow' % {id: id},
)
end
|
.update(id, **args) ⇒ Object
Also known as:
edit
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
|
# File 'lib/mangadex/scanlation_group.rb', line 65
def update(id, **args)
Mangadex::Internal::Request.put(
'/group/%{id}' % {id: id},
payload: Mangadex::Internal::Definition.validate(args, {
name: { accepts: String },
website: { accepts: String },
irc_server: { accepts: String },
irc_channel: { accepts: String },
discord: { accepts: String },
contact_email: { accepts: String },
description: { accepts: String },
locked: { accepts: [true, false] },
version: { accepts: Integer, required: true },
}),
)
end
|
.view(id) ⇒ Object
Also known as:
get