Class: Arssene::ChannelPresenter

Inherits:
Object
  • Object
show all
Defined in:
lib/arssene/lib/presenters/channel_presenter.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(channel) ⇒ ChannelPresenter

Returns a new instance of ChannelPresenter.



7
8
9
# File 'lib/arssene/lib/presenters/channel_presenter.rb', line 7

def initialize(channel)
  @channel = channel
end

Instance Attribute Details

#channelObject

Returns the value of attribute channel.



5
6
7
# File 'lib/arssene/lib/presenters/channel_presenter.rb', line 5

def channel
  @channel
end

Instance Method Details

#filter(options) ⇒ Object



11
12
13
14
15
16
17
18
19
# File 'lib/arssene/lib/presenters/channel_presenter.rb', line 11

def filter(options)
  return channel unless options

  filter_by_ignore(options) if options[:ignore]
  filter_by_date(options)   if options[:from_date]
  limit(options)            if options[:limit]

  channel
end