Class: Mangadex::ChapterReadMarker

Inherits:
Object
  • Object
show all
Extended by:
T::Sig
Defined in:
lib/mangadex/chapter_read_marker.rb

Class Method Summary collapse

Class Method Details

.create(id, **args) ⇒ Object



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

def self.create(id, **args)
  Mangadex::Internal::Definition.must(id)

  Mangadex::Internal::Request.post(
    '/manga/{id}/read' % {id: id},
    payload: Mangadex::Internal::Definition.validate(args, {
      update_history: { accepts: [true, false] }
    })
  )
end

.get(id) ⇒ Object



6
7
8
9
10
11
12
# File 'lib/mangadex/chapter_read_marker.rb', line 6

def self.get(id)
  Mangadex::Internal::Definition.must(id)

  Mangadex::Internal::Request.get(
    '/manga/{id}/read' % {id: id}
  )
end

.list(**args) ⇒ Object



27
28
29
30
31
32
33
34
35
# File 'lib/mangadex/chapter_read_marker.rb', line 27

def self.list(**args)
  Mangadex::Internal::Request.get(
    '/manga/list',
    Mangadex::Internal::Definition.validate(args, {
      ids: { accepts: [String], converts: :to_a, required: true },
      grouped: { accepts: [true, false] },
    })
  )
end

.user_listObject



38
39
40
41
42
43
# File 'lib/mangadex/chapter_read_marker.rb', line 38

def self.user_list
  Mangadex::Internal::Request.get(
    '/user/history',
    auth: true,
  )
end