Class: Aspect

Inherits:
ApplicationRecord show all
Defined in:
app/models/aspect.rb

Overview

Copyright © 2010-2011, Diaspora Inc. This file is

licensed under the Affero General Public License version 3 or later.  See
the COPYRIGHT file.

Instance Method Summary collapse

Instance Method Details

#<<(shareable) ⇒ Object


33
34
35
36
37
38
39
40
41
42
# File 'app/models/aspect.rb', line 33

def << (shareable)
  case shareable
    when Post
      self.posts << shareable
    when Photo
      self.photos << shareable
    else
      raise "Unknown shareable type '#{shareable.class.base_class.to_s}'"
  end
end

#to_sObject


29
30
31
# File 'app/models/aspect.rb', line 29

def to_s
  name
end