Class: Forem::Services::EventService
- Inherits:
-
BaseService
- Object
- BaseService
- Forem::Services::EventService
- Defined in:
- lib/forem/services/event_service.rb
Overview
Service for interacting with the Forem Events API.
Events represent live streams, hackathons, takeovers, or community meetups. Access via Client#events. All methods inject the client's requestor automatically so no additional configuration is required.
Instance Method Summary collapse
-
#create(params = {}, opts = {}) ⇒ Event
Create a new event or upsert by matching slugs / ID.
-
#delete(id, opts = {}) ⇒ nil
Delete an event.
-
#list(params = {}, opts = {}) ⇒ Forem::ListObject<Event>
List all events.
-
#retrieve(id, opts = {}) ⇒ Event
Retrieve a single event by its numeric ID or slug.
-
#update(id, params = {}, opts = {}) ⇒ Event
Update an existing event.
Methods inherited from BaseService
Constructor Details
This class inherits a constructor from Forem::Services::BaseService
Instance Method Details
#create(params = {}, opts = {}) ⇒ Event
Create a new event or upsert by matching slugs / ID.
Accepts flat attribute hashes or nested under :event.
85 86 87 |
# File 'lib/forem/services/event_service.rb', line 85 def create(params = {}, opts = {}) Event.create(params, opts_with_requestor(opts)) end |
#delete(id, opts = {}) ⇒ nil
Delete an event.
116 117 118 |
# File 'lib/forem/services/event_service.rb', line 116 def delete(id, opts = {}) Event.delete(id, opts_with_requestor(opts)) end |
#list(params = {}, opts = {}) ⇒ Forem::ListObject<Event>
List all events.
31 32 33 |
# File 'lib/forem/services/event_service.rb', line 31 def list(params = {}, opts = {}) Event.list(params, opts_with_requestor(opts)) end |