Class: Brainzz::ViewCountCommand

Inherits:
AnalyticsCommand show all
Defined in:
lib/brainzz/commands/view_count_command.rb

Class Method Summary collapse

Class Method Details

.execute(video_id, start_date, end_date) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/brainzz/commands/view_count_command.rb', line 4

def execute(video_id, start_date, end_date)
  view_count_params = ViewCountParams.new({
    :video_id      => video_id,
    :start_date    => start_date,
    :end_date      => end_date
  })

  if view_count_params.valid?
    ViewCountResponse.new get(view_count_params)
  else
    ViewCountResponse.new
  end
end