Class: Aspect

Inherits:
ActiveRecord::Base
  • Object
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


27
28
29
30
31
32
33
34
35
36
# File 'app/models/aspect.rb', line 27

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


23
24
25
# File 'app/models/aspect.rb', line 23

def to_s
  name
end