Class: RageRender::PaginatedComicDrop

Inherits:
Jekyll::Drops::DocumentDrop
  • Object
show all
Extended by:
Pipettes
Defined in:
lib/ragerender/jekyll/comics.rb

Constant Summary collapse

THUMBNAIL_MAX_HEIGHT =
420
THUMBNAIL_MAX_WIDTH =
400
THUMBNAIL_SMALL_MAX_HEIGHT =
210
THUMBNAIL_SMALL_MAX_WIDTH =
200

Instance Method Summary collapse

Methods included from Pipettes

clean_payload, def_data_delegator, def_image_metadata, def_loop, def_pages, def_safe_delegator, extended, loops, own_methods

Constructor Details

#initialize(obj, all) ⇒ PaginatedComicDrop

Returns a new instance of PaginatedComicDrop.



134
135
136
137
# File 'lib/ragerender/jekyll/comics.rb', line 134

def initialize obj, all
  super(obj)
  @all = all
end

Instance Method Details

#chapterendObject



152
153
154
# File 'lib/ragerender/jekyll/comics.rb', line 152

def chapterend
  @all.select {|c| c.data['chapter'] == @obj.data['chapter'] }.last == @obj
end

#newchapterObject



148
149
150
# File 'lib/ragerender/jekyll/comics.rb', line 148

def newchapter
  @all.select {|c| c.data['chapter'] == @obj.data['chapter'] }.first == @obj
end

#numberObject



144
145
146
# File 'lib/ragerender/jekyll/comics.rb', line 144

def number
  @all.index(@obj) + 1
end

#thumbnail_heightObject



162
163
164
# File 'lib/ragerender/jekyll/comics.rb', line 162

def thumbnail_height
  scaled_height(comicdrop.comicwidth, comicdrop.comicheight, THUMBNAIL_MAX_WIDTH, THUMBNAIL_MAX_HEIGHT) || 0
end

#thumbnail_height_smallObject



170
171
172
# File 'lib/ragerender/jekyll/comics.rb', line 170

def thumbnail_height_small
  scaled_height(comicdrop.comicwidth, comicdrop.comicheight, THUMBNAIL_SMALL_MAX_WIDTH, THUMBNAIL_SMALL_MAX_HEIGHT) || 0
end

#thumbnail_widthObject



158
159
160
# File 'lib/ragerender/jekyll/comics.rb', line 158

def thumbnail_width
  scaled_width(comicdrop.comicwidth, comicdrop.comicheight, THUMBNAIL_MAX_WIDTH, THUMBNAIL_MAX_HEIGHT) || 0
end

#thumbnail_width_smallObject



166
167
168
# File 'lib/ragerender/jekyll/comics.rb', line 166

def thumbnail_width_small
  scaled_width(comicdrop.comicwidth, comicdrop.comicheight, THUMBNAIL_SMALL_MAX_WIDTH, THUMBNAIL_SMALL_MAX_HEIGHT) || 0
end