Class: Stream::Person

Inherits:
Base
  • Object
show all
Defined in:
lib/stream/person.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.

Constant Summary

Constants inherited from Base

Base::TYPES_OF_POST_IN_STREAM

Instance Attribute Summary collapse

Attributes inherited from Base

#max_time, #order, #publisher, #user

Instance Method Summary collapse

Methods inherited from Base

#aspect, #aspect_ids, #aspects, #can_comment?, #contacts_link, #contacts_title, #for_all_aspects?, #link, #people, #post_from_group, #stream_posts, #title

Constructor Details

#initialize(user, person, opts = {}) ⇒ Person


9
10
11
12
# File 'lib/stream/person.rb', line 9

def initialize(user, person, opts={})
  self.person = person
  super(user, opts)
end

Instance Attribute Details

#personObject

Returns the value of attribute person


7
8
9
# File 'lib/stream/person.rb', line 7

def person
  @person
end

Instance Method Details

#postsActiveRecord::Association<Post>


15
16
17
# File 'lib/stream/person.rb', line 15

def posts
  @posts ||= user.present? ? user.posts_from(@person) : @person.posts.where(:public => true)
end