Module: SocialStream::Models::Supertype
- Extended by:
- ActiveSupport::Concern
- Includes:
- ActivityStreams::Supertype
- Defined in:
- lib/social_stream/models/supertype.rb
Overview
Common methods for models having many subtypes. Currently, there are two supertypes:
-
Actor: participates in the social network and has Ties with other actors. Its subtypes are subjects, such as User or Group
-
ActivityObject: created and managed by Actors in Activities. Its subtypes are objects, like Post or Comment
Methods are documented for the case of Actor supertype
Defined Under Namespace
Modules: ActiveRecord, ClassMethods
Instance Method Summary collapse
Methods included from ActivityStreams::Supertype
Instance Method Details
#subtype_instance ⇒ Object
66 67 68 69 70 71 |
# File 'lib/social_stream/models/supertype.rb', line 66 def subtype_instance if __send__("#{ self.class.subtypes_name }_type").present? # if object_type.present? object_class = __send__("#{ self.class.subtypes_name }_type") # object_class = object_type # => "Video" __send__ object_class.constantize.base_class.to_s.underscore # __send__ "document" end # end end |