Methods
A
C
D
M
N
O
P
T
Attributes
[RW] params
Class Public methods
comments()
# File lib/event_filter.rb, line 17
def comments
  'comments'
end
default_filter()
# File lib/event_filter.rb, line 5
def default_filter
  %w{ push issues merge_requests team}
end
merged()
# File lib/event_filter.rb, line 13
def merged
  'merged'
end
new(params)
# File lib/event_filter.rb, line 26
def initialize params
  @params = if params
              params.dup
            else
              []#EventFilter.default_filter
            end
end
push()
# File lib/event_filter.rb, line 9
def push
  'push'
end
team()
# File lib/event_filter.rb, line 21
def team
  'team'
end
Instance Public methods
active?(key)
# File lib/event_filter.rb, line 65
def active? key
  params.include? key
end
apply_filter(events)
# File lib/event_filter.rb, line 34
def apply_filter events
  return events unless params.present?

  filter = params.dup

  actions = []
  actions << Event::Pushed if filter.include? 'push'
  actions << Event::Merged if filter.include? 'merged'

  if filter.include? 'team'
    actions << Event::Joined
    actions << Event::Left
  end

  actions << Event::Commented if filter.include? 'comments'

  events = events.where(action: actions)
end
options(key)
# File lib/event_filter.rb, line 53
def options key
  filter = params.dup

  if filter.include? key
    filter.delete key
  else
    filter << key
  end

  filter
end