Class: ActivityStreams::Collection

Inherits:
Base
  • Object
show all
Defined in:
lib/activitystreams/collection.rb

Direct Known Subclasses

Stream

Instance Method Summary collapse

Methods inherited from Base

#as_json, #initialize

Methods included from Validator

#to_float, #to_integer, #to_iri, #to_time, #validate_attribute!

Constructor Details

This class inherits a constructor from ActivityStreams::Base

Instance Method Details

#item_classObject



14
15
16
# File 'lib/activitystreams/collection.rb', line 14

def item_class
  Object
end

#validate_attributes!Object



5
6
7
8
9
10
11
12
# File 'lib/activitystreams/collection.rb', line 5

def validate_attributes!
  super
  if items.blank? && url.blank?
    raise AttrMissing.new('Either "items" or "url" is required')
  end
  to_iri :url
  validate_attribute! :items, item_class, :arrayed!
end