Class: Brainzz::AnalyticsParams
- Inherits:
-
BaseParams
- Object
- BaseParams
- Brainzz::AnalyticsParams
- Defined in:
- lib/brainzz/params/analytics_params.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#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.
6 7 8 9 |
# File 'lib/brainzz/params/analytics_params.rb', line 6 def initialize(params) @start_date = normalize_date(params[:start_date]) @end_date = normalize_date(params[:end_date]) end |
Instance Attribute Details
#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
11 12 13 |
# File 'lib/brainzz/params/analytics_params.rb', line 11 def valid? !!(start_date && end_date) end |