Class: BadPigeon::EntryFilter

Inherits:
Object
  • Object
show all
Includes:
Assertions
Defined in:
lib/bad_pigeon/entry_filter.rb

Instance Method Summary collapse

Methods included from Assertions

extended, included

Instance Method Details

#include_entry?(entry) ⇒ Boolean

Returns:

  • (Boolean)


8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/bad_pigeon/entry_filter.rb', line 8

def include_entry?(entry)
  case entry.component
  when Component::ORGANIC_FEED_TWEET,
       Component::ORGANIC_LIST_TWEET,
       Component::NORMAL_TWEET,
       Component::FOLLOWING,
       Component::PINNED_TWEET,
       Component::PINNED_TWEETS,
       Component::EXTENDED_REPLY,
       Component::SOCIAL_CONTEXT,
       Component::SOCIAL_ACTIVITY,
       Component::RANKED_FEED_TWEET
       then true

  when Component::PROMOTED_TWEET,
       Component::FOLLOWING_PROMOTED,
       Component::FOLLOW_SUGGESTIONS
       then false

  when nil
    true

  else
    assert("Unknown component: #{entry.component}")
    false
  end
end