module SocialStream::Models::Supertype
Common methods for models having many {SocialStream::Models::Subtype subtypes}. Currently, there are two {SocialStream::Models::Supertype supertypes}:
-
{Actor}: participates in the social network and has {Tie Ties} with other actors. Its subtypes are {SocialStream::Models::Subject subjects}, such as {User} or {Group}
-
{ActivityObject}: created and managed by {Actor Actors} in {Activity Activities}. Its subtypes are {SocialStream::Models::Object objects}, like {Post} or {Comment}
Methods are documented for the case of {Actor} supertype
Public Instance Methods
subtype_instance()
click to toggle source
# 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