Class: Bookify::Node::Image

Inherits:
Base
  • Object
show all
Defined in:
lib/bookify/node/image.rb

Constant Summary

Constants inherited from Base

Base::FONTS

Instance Attribute Summary

Attributes inherited from Base

#node, #pdf

Instance Method Summary collapse

Methods inherited from Base

#clean_html, #font, #html_classes, #initialize, #method_missing, render

Constructor Details

This class inherits a constructor from Bookify::Node::Base

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Bookify::Node::Base

Instance Method Details

#pathObject



13
14
15
# File 'lib/bookify/node/image.rb', line 13

def path
  "src/#{node.attr(:src)}"
end

#renderObject



3
4
5
6
7
8
9
10
11
# File 'lib/bookify/node/image.rb', line 3

def render
  options = {
    position: html_classes.include?("center") ? :center : :left,
    height: node.attr(:height).to_f
  }

  image path, options
  move_down 15
end