class Mangadex::ScanlationGroup

Public Class Methods

create(**args) click to toggle source
# 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
delete(id) click to toggle source
# File lib/mangadex/scanlation_group.rb, line 82
def delete(id)
  Mangadex::Internal::Request.delete(
    '/group/%{id}' % {id: id},
  )
end
edit(id, **args)
Alias for: update
follow(id) click to toggle source
# File lib/mangadex/scanlation_group.rb, line 88
def follow(id)
  Mangadex::Internal::Request.post(
    '/group/%{id}/follow' % {id: id},
  )
end
get(id)
Alias for: view
inspect_attributes() click to toggle source
# File lib/mangadex/scanlation_group.rb, line 106
def self.inspect_attributes
  self.attributes - [:version, :created_at, :updated_at]
end
list(**args) click to toggle source
# File lib/mangadex/scanlation_group.rb, line 26
def list(**args)
  Mangadex::Internal::Request.get(
    '/group',
    Mangadex::Internal::Definition.validate(args, {
      limit: { accepts: Integer },
      offset: { accepts: Integer },
      ids: { accepts: [String] },
      name: { accepts: String },
      includes: { accepts: [String] },
    }),
  )
end
unfollow(id) click to toggle source
# File lib/mangadex/scanlation_group.rb, line 94
def unfollow(id)
  Mangadex::Internal::Request.delete(
    '/group/%{id}/follow' % {id: id},
  )
end
update(id, **args) click to toggle source
# 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
Also aliased as: edit
view(id) click to toggle source
# File lib/mangadex/scanlation_group.rb, line 54
def view(id)
  Mangadex::Internal::Definition.must(id)

  Mangadex::Internal::Request.get(
    '/group/%{id}' % {id: id},
    Mangadex::Internal::Definition.validate(args, {
      includes: { accepts: [String] },
    }),
  )
end
Also aliased as: get