Class: NewsmastMastodon::CustomFeed
- Inherits:
-
Object
- Object
- NewsmastMastodon::CustomFeed
- Includes:
- Redisable
- Defined in:
- app/models/newsmast_mastodon/custom_feed.rb
Instance Method Summary collapse
- #get(limit, max_id = nil, since_id = nil, min_id = nil) ⇒ Array<Status>
-
#initialize(account, options = {}) ⇒ CustomFeed
constructor
A new instance of CustomFeed.
Constructor Details
#initialize(account, options = {}) ⇒ CustomFeed
Returns a new instance of CustomFeed.
14 15 16 17 |
# File 'app/models/newsmast_mastodon/custom_feed.rb', line 14 def initialize(account, = {}) @account = account @options = end |
Instance Method Details
#get(limit, max_id = nil, since_id = nil, min_id = nil) ⇒ Array<Status>
24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'app/models/newsmast_mastodon/custom_feed.rb', line 24 def get(limit, max_id = nil, since_id = nil, min_id = nil) scope = custom_scope scope.merge!(without_replies_scope) unless with_replies? scope.merge!(without_reblogs_scope) unless with_reblogs? scope.merge!(local_only_scope) if local_only? scope.merge!(remote_only_scope) if remote_only? scope.merge!(account_filters_scope) if account? scope.merge!(media_only_scope) if media_only? scope.merge!(language_scope) if account&.chosen_languages.present? scope.to_a_paginated_by_id(limit, max_id: max_id, since_id: since_id, min_id: min_id) end |