Class: Jekyll::ActivityPub::Image
- Inherits:
-
Object
- Object
- Jekyll::ActivityPub::Image
- Includes:
- Helper
- Defined in:
- lib/jekyll/activity_pub/image.rb
Overview
Represents an Image
Direct Known Subclasses
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
Instance Method Summary collapse
-
#initialize(site, path, description = nil) ⇒ Image
constructor
Initialize with default data.
Methods included from Helper
#content, #generate_excerpt?, #hook_owner, #locale, #place_in_layout?, #pruned_data, #render_with_liquid?, #to_json, #to_liquid, #trigger_hooks
Constructor Details
#initialize(site, path, description = nil) ⇒ Image
Initialize with default data
20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/jekyll/activity_pub/image.rb', line 20 def initialize(site, path, description = nil) @context = StubContext.new(registers: { site: site }) @data = { 'type' => 'Image', 'mediaType' => Marcel::MimeType.for(Pathname.new(site.in_source_dir(path))), 'url' => absolute_url(path), 'name' => description.to_s } trigger_hooks :post_init end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
13 14 15 |
# File 'lib/jekyll/activity_pub/image.rb', line 13 def data @data end |