Class: ROCrate::Preview
- Inherits:
-
File
- Object
- Entity
- DataEntity
- File
- ROCrate::Preview
- Defined in:
- lib/ro_crate/model/preview.rb
Overview
A representation of the ‘ro-crate-preview.html` file.
Constant Summary collapse
- IDENTIFIER =
'ro-crate-preview.html'.freeze
- DEFAULT_TEMPLATE =
::File.(::File.join(::File.dirname(__FILE__), '..', 'ro-crate-preview.html.erb'))
Instance Attribute Summary collapse
-
#template ⇒ String
The ERB template to use when rendering the preview.
Attributes inherited from Entity
Instance Method Summary collapse
-
#initialize(crate, source = nil, properties = {}) ⇒ Preview
constructor
A new instance of Preview.
Methods inherited from File
format_local_id, #payload, #remote?, #source
Methods inherited from DataEntity
#filepath, #payload, specialize
Methods inherited from Entity
#==, #[], #[]=, #auto_dereference, #auto_reference, #canonical_id, #delete, #dereference, #eql?, #external?, format_id, format_local_id, #has_type?, #hash, #id, #id=, #inspect, #linked_entities, properties, #raw_properties, #reference, #to_json, #type, #type=
Constructor Details
#initialize(crate, source = nil, properties = {}) ⇒ Preview
Returns a new instance of Preview.
15 16 17 18 19 |
# File 'lib/ro_crate/model/preview.rb', line 15 def initialize(crate, source = nil, properties = {}) source ||= PreviewGenerator.new(self) @template = nil super(crate, source, IDENTIFIER, properties) end |
Instance Attribute Details
#template ⇒ String
The ERB template to use when rendering the preview.
13 14 15 |
# File 'lib/ro_crate/model/preview.rb', line 13 def template @template end |