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:

Methods are documented for the case of Actor supertype

Defined Under Namespace

Modules: ActiveRecord, ClassMethods

Instance Method Summary collapse

Methods included from ActivityStreams::Supertype

#as_object_type

Instance Method Details

#subtype_instanceObject



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