Class: SolidObserver::Params::EventsFilter
- Inherits:
-
Object
- Object
- SolidObserver::Params::EventsFilter
- Defined in:
- lib/solid_observer/params/events_filter.rb
Instance Attribute Summary collapse
-
#event_type ⇒ Object
readonly
Returns the value of attribute event_type.
-
#from ⇒ Object
readonly
Returns the value of attribute from.
-
#job_class ⇒ Object
readonly
Returns the value of attribute job_class.
-
#page ⇒ Object
readonly
Returns the value of attribute page.
-
#queue_name ⇒ Object
readonly
Returns the value of attribute queue_name.
-
#to ⇒ Object
readonly
Returns the value of attribute to.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(event_type:, job_class:, queue_name:, from:, to:, page:) ⇒ EventsFilter
constructor
A new instance of EventsFilter.
Constructor Details
#initialize(event_type:, job_class:, queue_name:, from:, to:, page:) ⇒ EventsFilter
Returns a new instance of EventsFilter.
31 32 33 34 |
# File 'lib/solid_observer/params/events_filter.rb', line 31 def initialize(event_type:, job_class:, queue_name:, from:, to:, page:) @event_type, @job_class, @queue_name = event_type, job_class, queue_name @from, @to, @page = from, to, page end |
Instance Attribute Details
#event_type ⇒ Object (readonly)
Returns the value of attribute event_type.
29 30 31 |
# File 'lib/solid_observer/params/events_filter.rb', line 29 def event_type @event_type end |
#from ⇒ Object (readonly)
Returns the value of attribute from.
29 30 31 |
# File 'lib/solid_observer/params/events_filter.rb', line 29 def from @from end |
#job_class ⇒ Object (readonly)
Returns the value of attribute job_class.
29 30 31 |
# File 'lib/solid_observer/params/events_filter.rb', line 29 def job_class @job_class end |
#page ⇒ Object (readonly)
Returns the value of attribute page.
29 30 31 |
# File 'lib/solid_observer/params/events_filter.rb', line 29 def page @page end |
#queue_name ⇒ Object (readonly)
Returns the value of attribute queue_name.
29 30 31 |
# File 'lib/solid_observer/params/events_filter.rb', line 29 def queue_name @queue_name end |
#to ⇒ Object (readonly)
Returns the value of attribute to.
29 30 31 |
# File 'lib/solid_observer/params/events_filter.rb', line 29 def to @to end |
Class Method Details
.from_params(params) ⇒ Object
6 7 8 9 10 11 12 13 14 15 |
# File 'lib/solid_observer/params/events_filter.rb', line 6 def self.from_params(params) new( event_type: params[:event_type].presence, job_class: params[:job_class].presence, queue_name: params[:queue_name].presence, from: parse_date(params[:from]), to: parse_date(params[:to]), page: (params[:page].presence || 1).to_i ) end |