Class: WaxTasks::Collection

Inherits:
Object
  • Object
show all
Includes:
Images, Metadata
Defined in:
lib/wax_tasks/collection.rb,
lib/wax_tasks/collection/images.rb,
lib/wax_tasks/collection/metadata.rb

Defined Under Namespace

Modules: Images, Metadata

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Images

#add_font_matter_to_json_files, #add_iiif_results_to_records, #iiif_builder, #image_variants, #items_from_imagedata, #pre_process_pdfs, #write_iiif_derivatives, #write_simple_derivatives

Methods included from Metadata

#consolidate_records, #csv_string, #json_string, #records_from_metadata, #records_from_pages, #search_fields=, #update_metadata, #yaml_string

Constructor Details

#initialize(name, config, source, collections_dir, ext) ⇒ Collection

Returns a new instance of Collection.



17
18
19
20
21
22
23
24
25
26
27
# File 'lib/wax_tasks/collection.rb', line 17

def initialize(name, config, source, collections_dir, ext)
  @name             = name
  @config           = config
  @page_extension   = ext
  @site_source      = source
  @page_source      = Utils.safe_join source, collections_dir, "_#{name}"
  @metadata_source  = Utils.safe_join source, '_data', config.dig('metadata', 'source')
  @imagedata_source = Utils.safe_join source, '_data', config.dig('images', 'source')
  @search_fields    = %w[pid label thumbnail permalink collection]
  @image_variants   = image_variants
end

Instance Attribute Details

#configObject (readonly)

Returns the value of attribute config.



9
10
11
# File 'lib/wax_tasks/collection.rb', line 9

def config
  @config
end

#extObject (readonly)

Returns the value of attribute ext.



9
10
11
# File 'lib/wax_tasks/collection.rb', line 9

def ext
  @ext
end

#imagedata_sourceObject (readonly)

Returns the value of attribute imagedata_source.



9
10
11
# File 'lib/wax_tasks/collection.rb', line 9

def imagedata_source
  @imagedata_source
end

#metadata_sourceObject (readonly)

Returns the value of attribute metadata_source.



9
10
11
# File 'lib/wax_tasks/collection.rb', line 9

def 
  @metadata_source
end

#nameObject (readonly)

Returns the value of attribute name.



9
10
11
# File 'lib/wax_tasks/collection.rb', line 9

def name
  @name
end

#page_sourceObject (readonly)

Returns the value of attribute page_source.



9
10
11
# File 'lib/wax_tasks/collection.rb', line 9

def page_source
  @page_source
end

#search_fieldsObject (readonly)

Returns the value of attribute search_fields.



9
10
11
# File 'lib/wax_tasks/collection.rb', line 9

def search_fields
  @search_fields
end