Class: ExtractExifGps::HtmlRenderer

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

Overview

Render a FileSet as an HTML file

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(files, template:, title: 'EXIF GPS', search_paths: []) ⇒ HtmlRenderer

Returns a new instance of HtmlRenderer.

Parameters:

  • files (FileSet)
  • template (StringIO, #to_s)

    A StringIO containing the body of an ERB template, or the path to a template file

  • title (String) (defaults to: 'EXIF GPS')

    The title to use in the rendered HTML file

  • search_paths (Array<#to_s>) (defaults to: [])

    The directories searched for images



15
16
17
18
19
20
# File 'lib/html_renderer.rb', line 15

def initialize(files, template:, title: 'EXIF GPS', search_paths: [])
  @files = files
  @template = template
  @title = title
  @search_paths = search_paths
end

Instance Attribute Details

#filesObject (readonly)

Returns the value of attribute files.



8
9
10
# File 'lib/html_renderer.rb', line 8

def files
  @files
end

#search_pathsObject (readonly)

Returns the value of attribute search_paths.



8
9
10
# File 'lib/html_renderer.rb', line 8

def search_paths
  @search_paths
end

#titleObject (readonly)

Returns the value of attribute title.



8
9
10
# File 'lib/html_renderer.rb', line 8

def title
  @title
end

Instance Method Details

#to_sObject



22
23
24
# File 'lib/html_renderer.rb', line 22

def to_s
  erb.result(binding)
end