0
0
Fork 0

Allow ActivityPub Note's tag and attachment to be single objects (#5534)

This commit is contained in:
puckipedia 2017-10-27 16:10:36 +02:00 committed by Eugen Rochko
parent 0129f5eada
commit 0cb329f63a
2 changed files with 8 additions and 4 deletions

View file

@ -9,6 +9,10 @@ module JsonLdHelper
value.is_a?(Array) ? value.first : value
end
def as_array(value)
value.is_a?(Array) ? value : [value]
end
def value_or_id(value)
value.is_a?(String) || value.nil? ? value : value['id']
end