Class: NewsmastMastodon::ForYouFeed

Inherits:
Object
  • Object
show all
Includes:
Redisable
Defined in:
app/models/newsmast_mastodon/for_you_feed.rb

Instance Method Summary collapse

Constructor Details

#initialize(account, options = {}) ⇒ ForYouFeed

Returns a new instance of ForYouFeed.

Parameters:

  • account (Account)
  • options (Hash) (defaults to: {})
  • [Boolean] (Hash)

    a customizable set of options



12
13
14
15
# File 'app/models/newsmast_mastodon/for_you_feed.rb', line 12

def initialize(, options = {})
  @account = 
  @options = options
end

Instance Method Details

#get(limit, max_id = nil, since_id = nil, min_id = nil) ⇒ Array<Status>

Parameters:

  • limit (Integer)
  • max_id (Integer) (defaults to: nil)
  • since_id (Integer) (defaults to: nil)
  • min_id (Integer) (defaults to: nil)

Returns:

  • (Array<Status>)


22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'app/models/newsmast_mastodon/for_you_feed.rb', line 22

def get(limit, max_id = nil, since_id = nil, min_id = nil)
  @status = custom_scope

  without_reblogs_scope

  without_replies_scope          if exclude_replies?
  exclude_direct_statuses_scope  if exclude_direct_statuses?

  if grouped_admin_statuses?
    grouped_admin_statuses_scope
    grouped_admin_reblogged_statuses_scope
  end

  @status.to_a_paginated_by_id(limit, max_id: max_id, since_id: since_id, min_id: min_id)
end