Class: RageRender::ImageDrop

Inherits:
Jekyll::Drops::Drop
  • Object
show all
Extended by:
Forwardable, Pipettes
Defined in:
lib/ragerender/jekyll/image.rb

Direct Known Subclasses

MultiImageDrop

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, comicdrop) ⇒ ImageDrop

Returns a new instance of ImageDrop.



10
11
12
13
14
# File 'lib/ragerender/jekyll/image.rb', line 10

def initialize(obj, comicdrop)
  super(obj)
  @comic = comicdrop
  @image_obj = obj
end

Instance Method Details

#htmlObject

the html contents of this loop iteration. this includes stuff like a surrounding link to the next page



27
28
29
30
31
32
33
# File 'lib/ragerender/jekyll/image.rb', line 27

def html
  filehtml || [
    nextcomic ? "<a href=\"#{nextcomic}\">" : '',
    imageonlyhtml,
    nextcomic ? '</a>' : '',
  ].join
end

#imageonlyhtmlObject

an <img> tag containing the image, without surrounding link



17
18
19
20
21
22
23
# File 'lib/ragerender/jekyll/image.rb', line 17

def imageonlyhtml
  filehtml || <<~HTML
    <img id="comicimage" src="#{imageurl}" alt="#{comictitle}"
         width="#{width}" height="#{height}"
         title="#{comicdescription}">
  HTML
end

#imageurlObject



50
51
52
# File 'lib/ragerender/jekyll/image.rb', line 50

def imageurl
  image_url unless filehtml
end