Class: MangaedenApi::Chapter

Inherits:
Object
  • Object
show all
Defined in:
lib/mangaeden_api/chapter.rb

Overview

Class containing all chapter informations.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(images, chapter_info) ⇒ Chapter

Returns a new instance of Chapter.



8
9
10
11
12
13
14
15
16
# File 'lib/mangaeden_api/chapter.rb', line 8

def initialize(images, chapter_info)
  @chapter_id = chapter_info[3]
  @chapter_title = chapter_info[2]
  @chapter_number = chapter_info[0]
  @images = []
  images.each do |i|
    @images << { i[0] => "#{MangaedenApi::IMAGE_HOST}#{i[1]}" }
  end
end

Instance Attribute Details

#chapter_idObject

images is a Hash where the keys are the image number and the values are the image path



6
7
8
# File 'lib/mangaeden_api/chapter.rb', line 6

def chapter_id
  @chapter_id
end

#chapter_numberObject

images is a Hash where the keys are the image number and the values are the image path



6
7
8
# File 'lib/mangaeden_api/chapter.rb', line 6

def chapter_number
  @chapter_number
end

#chapter_titleObject

images is a Hash where the keys are the image number and the values are the image path



6
7
8
# File 'lib/mangaeden_api/chapter.rb', line 6

def chapter_title
  @chapter_title
end

#imagesObject

images is a Hash where the keys are the image number and the values are the image path



6
7
8
# File 'lib/mangaeden_api/chapter.rb', line 6

def images
  @images
end