Class: Jekyll::ActivityPub::Link

Inherits:
Object
  • Object
show all
Includes:
Helper
Defined in:
lib/jekyll/activity_pub/link.rb

Overview

Represents a Link

Instance Attribute Summary collapse

Instance Method Summary collapse

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, href, rel = nil, media_type = nil) ⇒ Link

Initialize with default data

Parameters:

  • :site (Jekyll::Site)
  • :href (String)
  • :rel (String)
  • :media_type (String)


19
20
21
22
23
24
25
26
27
28
29
# File 'lib/jekyll/activity_pub/link.rb', line 19

def initialize(site, href, rel = nil, media_type = nil)
  @site = site
  @data = {
    'type' => 'Link',
    'mediaType' => media_type,
    'href' => href,
    'rel' => rel
  }

  trigger_hooks :post_init
end

Instance Attribute Details

#dataObject (readonly)

Returns the value of attribute data.



11
12
13
# File 'lib/jekyll/activity_pub/link.rb', line 11

def data
  @data
end