Class: Brainzz::AnalyticsParams
- Inherits:
-
BaseParams
- Object
- BaseParams
- Brainzz::AnalyticsParams
- Defined in:
- lib/brainzz/params/analytics_params.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#content_owner ⇒ Object
readonly
Returns the value of attribute content_owner.
-
#end_date ⇒ Object
readonly
Returns the value of attribute end_date.
-
#start_date ⇒ Object
readonly
Returns the value of attribute start_date.
Instance Method Summary collapse
-
#initialize(params) ⇒ AnalyticsParams
constructor
A new instance of AnalyticsParams.
- #valid? ⇒ Boolean
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_owner ⇒ Object (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_date ⇒ Object (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_date ⇒ Object (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
13 14 15 |
# File 'lib/brainzz/params/analytics_params.rb', line 13 def valid? !!(start_date && end_date) end |