Class: Posthubify::QueueResource
- Inherits:
-
Object
- Object
- Posthubify::QueueResource
- Defined in:
- lib/posthubify/resources/platform.rb
Overview
Publishing queue (Node sdk .queue). Sub-resource: schedules.
Instance Attribute Summary collapse
-
#schedules ⇒ Object
readonly
Returns the value of attribute schedules.
Instance Method Summary collapse
-
#initialize(http) ⇒ QueueResource
constructor
A new instance of QueueResource.
-
#next_slot(profile_id: nil) ⇒ Object
The next EMPTY slot — posts.create(queue: true) lands here.
-
#preview(profile_id: nil, count: nil) ⇒ Object
Preview of upcoming slots (with taken flag).
Constructor Details
#initialize(http) ⇒ QueueResource
Returns a new instance of QueueResource.
99 100 101 102 |
# File 'lib/posthubify/resources/platform.rb', line 99 def initialize(http) @http = http @schedules = QueueSchedulesResource.new(http) end |
Instance Attribute Details
#schedules ⇒ Object (readonly)
Returns the value of attribute schedules.
97 98 99 |
# File 'lib/posthubify/resources/platform.rb', line 97 def schedules @schedules end |
Instance Method Details
#next_slot(profile_id: nil) ⇒ Object
The next EMPTY slot — posts.create(queue: true) lands here.
105 106 107 |
# File 'lib/posthubify/resources/platform.rb', line 105 def next_slot(profile_id: nil) @http.data('GET', '/queue/next-slot', query: { 'profileId' => profile_id }) end |
#preview(profile_id: nil, count: nil) ⇒ Object
Preview of upcoming slots (with taken flag).
110 111 112 |
# File 'lib/posthubify/resources/platform.rb', line 110 def preview(profile_id: nil, count: nil) @http.data('GET', '/queue/preview', query: { 'profileId' => profile_id, 'count' => count }) end |