activitypub 0.3.1 → 0.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3d6b1c47f6ac1051a3057f0ae8d57fe2d83c3c99aea99a45ff09c50f1f044a9b
4
- data.tar.gz: df120e3bad47452d3a22bb400feab41db3b4c27502b16247f389c751373ccb9b
3
+ metadata.gz: 112ee8d199c09e5d9ff788e2bdf02b80e745513a8812d01cfbf377fb56daac3b
4
+ data.tar.gz: 7132a7c5d296315c29dad6672a511841a0557640d2b43139d1d4399c71e10487
5
5
  SHA512:
6
- metadata.gz: bc9e697ab7e8b67c040c482d9ba1f63ada540f5b2d08a5da689495670f960a71900b21e11548c8fe97ddc205bb5185afa5273c20df53bea9ddd36a1633d8cc6d
7
- data.tar.gz: 27545eed23569575170cff387692c3d48ffe94c3afe0a9f417d37c121442852d3f5d145e4416ce5bec41c074a2e6ece46d4875183381c0c8b37d8bbb2d1821fd
6
+ metadata.gz: b3f3d2e3788239c080ac7354fa5a02e27ac242911374d86b579473c0ae451f1d46eff8033b7ae91abb8cda24e865cf9c58ebfd2fbc2c86257b4ed01e3856f0a4
7
+ data.tar.gz: 8c7b248e72822ca739272b4315fc3256aefe96a333b81ca0676a5717162fd345a6ff2e3eef2ff3d989172abbad8124a652c5aa6cf105c1a7880643aa20c03c53
@@ -13,7 +13,15 @@ module ActivityPub
13
13
 
14
14
  klass = ActivityPub.const_get(type)
15
15
 
16
- klass ? klass.new : nil
16
+ ob = klass ? klass.new : nil
17
+
18
+ if ob
19
+ klass.ap_attributes.each do |attr|
20
+ ob.instance_variable_set("@#{attr}", h.dig(attr.to_s))
21
+ end
22
+ end
23
+
24
+ ob
17
25
  end
18
26
 
19
27
  # This is not part of ActivityPub, but provides basic mechanisms
@@ -10,6 +10,7 @@ module ActivityPub
10
10
  end
11
11
 
12
12
  class Object < Base
13
+ ap_attr :id
13
14
  ap_attr :attachment, :attributedTo, :audience, :content, :context,
14
15
  :name, :endTime, :generator, :icon, :image, :inReplyTo, :location,
15
16
  :preview, :published, :replies, :startTime, :summary, :tag, :updated,
@@ -161,6 +162,10 @@ module ActivityPub
161
162
  end
162
163
 
163
164
  class Person < Actor
165
+
166
+ # Mastodon extension per
167
+ # https://docs-p.joinmastodon.org/spec/activitypub/#extensions
168
+ ap_attr :likes, :bookmarks, :manuallyApprovesFollowers
164
169
  end
165
170
 
166
171
  class Service < Actor
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ActivityPub
4
- VERSION = "0.3.1"
4
+ VERSION = "0.3.2"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activitypub
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vidar Hokstad