Class: Unit::Event::ListEventParams
- Inherits:
-
Object
- Object
- Unit::Event::ListEventParams
- Defined in:
- lib/unit/models/event/list_event_params.rb
Instance Attribute Summary collapse
-
#_until ⇒ Object
readonly
Returns the value of attribute _until.
-
#limit ⇒ Object
readonly
Returns the value of attribute limit.
-
#offset ⇒ Object
readonly
Returns the value of attribute offset.
-
#since ⇒ Object
readonly
Returns the value of attribute since.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(limit = EVENT_LIST_LIMIT, offset = EVENT_LIST_OFFSET, type = nil, since = nil, _until = nil) ⇒ ListEventParams
constructor
A new instance of ListEventParams.
- #to_hash ⇒ Object
Constructor Details
#initialize(limit = EVENT_LIST_LIMIT, offset = EVENT_LIST_OFFSET, type = nil, since = nil, _until = nil) ⇒ ListEventParams
Returns a new instance of ListEventParams.
15 16 17 18 19 20 21 |
# File 'lib/unit/models/event/list_event_params.rb', line 15 def initialize(limit = EVENT_LIST_LIMIT, offset = EVENT_LIST_OFFSET, type = nil, since = nil, _until = nil) @limit = limit @offset = offset @type = type @since = since @_until = _until end |
Instance Attribute Details
#_until ⇒ Object (readonly)
Returns the value of attribute _until.
8 9 10 |
# File 'lib/unit/models/event/list_event_params.rb', line 8 def _until @_until end |
#limit ⇒ Object (readonly)
Returns the value of attribute limit.
8 9 10 |
# File 'lib/unit/models/event/list_event_params.rb', line 8 def limit @limit end |
#offset ⇒ Object (readonly)
Returns the value of attribute offset.
8 9 10 |
# File 'lib/unit/models/event/list_event_params.rb', line 8 def offset @offset end |
#since ⇒ Object (readonly)
Returns the value of attribute since.
8 9 10 |
# File 'lib/unit/models/event/list_event_params.rb', line 8 def since @since end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
8 9 10 |
# File 'lib/unit/models/event/list_event_params.rb', line 8 def type @type end |
Instance Method Details
#to_hash ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/unit/models/event/list_event_params.rb', line 23 def to_hash params = { "page[limit]": limit, "page[offset]": offset, "filter[since]": since, "filter[until]": _until } type&.each_with_index&.map do |val, index| params.merge!({ "filter[type][#{index}]": val }) end params.compact end |