Class: SocialNetworking::Concerns::ProfilePage::Feed
- Inherits:
-
Object
- Object
- SocialNetworking::Concerns::ProfilePage::Feed
- Defined in:
- app/controllers/social_networking/concerns/profile_page/feed.rb
Overview
Displays feed data for profile page.
Constant Summary collapse
- SHARED_ITEM_PAGE_SIZE =
10
Instance Attribute Summary collapse
-
#page ⇒ Object
readonly
Returns the value of attribute page.
-
#participant_id ⇒ Object
readonly
Returns the value of attribute participant_id.
Instance Method Summary collapse
-
#initialize(participant_id:, page:) ⇒ Feed
constructor
A new instance of Feed.
- #page_items ⇒ Object
Constructor Details
#initialize(participant_id:, page:) ⇒ Feed
Returns a new instance of Feed.
10 11 12 13 |
# File 'app/controllers/social_networking/concerns/profile_page/feed.rb', line 10 def initialize(participant_id:, page:) @participant_id = participant_id @page = page.try(:to_i) || 0 end |
Instance Attribute Details
#page ⇒ Object (readonly)
Returns the value of attribute page.
7 8 9 |
# File 'app/controllers/social_networking/concerns/profile_page/feed.rb', line 7 def page @page end |
#participant_id ⇒ Object (readonly)
Returns the value of attribute participant_id.
7 8 9 |
# File 'app/controllers/social_networking/concerns/profile_page/feed.rb', line 7 def participant_id @participant_id end |
Instance Method Details
#page_items ⇒ Object
15 16 17 18 19 20 21 22 23 |
# File 'app/controllers/social_networking/concerns/profile_page/feed.rb', line 15 def page_items if feed_items.size >= start_index sorted_feed_items[ start_index..(start_index + SHARED_ITEM_PAGE_SIZE - 1) ] else [] end end |