Class: Brainzz::AnalyticsParams

Inherits:
BaseParams show all
Defined in:
lib/brainzz/params/analytics_params.rb

Direct Known Subclasses

StatsParams

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params) ⇒ AnalyticsParams

Returns a new instance of AnalyticsParams.



7
8
9
10
11
# File 'lib/brainzz/params/analytics_params.rb', line 7

def initialize(params)
  @start_date    = normalize_date(params[:start_date])
  @end_date      = normalize_date(params[:end_date])
  @content_owner = params[:content_owner]
end

Instance Attribute Details

#content_ownerObject (readonly)

Returns the value of attribute content_owner.



5
6
7
# File 'lib/brainzz/params/analytics_params.rb', line 5

def content_owner
  @content_owner
end

#end_dateObject (readonly)

Returns the value of attribute end_date.



4
5
6
# File 'lib/brainzz/params/analytics_params.rb', line 4

def end_date
  @end_date
end

#start_dateObject (readonly)

Returns the value of attribute start_date.



3
4
5
# File 'lib/brainzz/params/analytics_params.rb', line 3

def start_date
  @start_date
end

Instance Method Details

#valid?Boolean

Returns:

  • (Boolean)


13
14
15
# File 'lib/brainzz/params/analytics_params.rb', line 13

def valid?
  !!(start_date && end_date)
end