module SocialStream::Models::Supertype

Common methods for models having many {SocialStream::Models::Subtype subtypes}. Currently, there are two {SocialStream::Models::Supertype supertypes}:

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