Class: Forem::Services::TrendService
- Inherits:
-
BaseService
- Object
- BaseService
- Forem::Services::TrendService
- Defined in:
- lib/forem/services/trend_service.rb
Overview
Service for interacting with the Forem Trends API.
Trends are algorithmically-derived, "hot and recent" topic clusters made up of related articles. Access via Client#trends. All methods inject the client's requestor automatically so no additional configuration is required. Trends are read-only via the public API.
Instance Method Summary collapse
-
#articles(id_or_slug, params = {}, opts = {}) ⇒ Array<Forem::Article>
List the articles belonging to a trend.
-
#list(params = {}, opts = {}) ⇒ Forem::ListObject<Trend>
List hot and recent trends.
-
#retrieve(id_or_slug, opts = {}) ⇒ Trend
Retrieve a single trend by its numeric ID or slug.
Methods inherited from BaseService
Constructor Details
This class inherits a constructor from Forem::Services::BaseService
Instance Method Details
#articles(id_or_slug, params = {}, opts = {}) ⇒ Array<Forem::Article>
List the articles belonging to a trend.
65 66 67 |
# File 'lib/forem/services/trend_service.rb', line 65 def articles(id_or_slug, params = {}, opts = {}) Trend.articles(id_or_slug, params, opts_with_requestor(opts)) end |
#list(params = {}, opts = {}) ⇒ Forem::ListObject<Trend>
List hot and recent trends.
31 32 33 |
# File 'lib/forem/services/trend_service.rb', line 31 def list(params = {}, opts = {}) Trend.list(params, opts_with_requestor(opts)) end |