Class: Tightknit::Resources::Feeds
- Inherits:
-
Object
- Object
- Tightknit::Resources::Feeds
- Defined in:
- lib/tightknit/resources/feeds.rb
Overview
The Feeds class provides methods for interacting with the feeds API. It allows listing feeds and retrieving posts from feeds.
Instance Method Summary collapse
-
#get(feed_id) ⇒ Hash
Get a specific feed.
-
#initialize(client) ⇒ Feeds
constructor
Initialize a new Feeds resource.
-
#list(options = {}) ⇒ Hash
Get a list of feeds in the community.
-
#posts(feed_id, options = {}) ⇒ Hash
Get posts from a specific feed.
Constructor Details
#initialize(client) ⇒ Feeds
Initialize a new Feeds resource
25 26 27 |
# File 'lib/tightknit/resources/feeds.rb', line 25 def initialize(client) @client = client end |
Instance Method Details
#get(feed_id) ⇒ Hash
Get a specific feed
52 53 54 |
# File 'lib/tightknit/resources/feeds.rb', line 52 def get(feed_id) @client.get("feeds/#{feed_id}") end |
#list(options = {}) ⇒ Hash
Get a list of feeds in the community
35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/tightknit/resources/feeds.rb', line 35 def list( = {}) page = [:page] || 0 per_page = [:per_page] || 10 params = { page: page, per_page: per_page } @client.get("feeds", params) end |
#posts(feed_id, options = {}) ⇒ Hash
Get posts from a specific feed
64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/tightknit/resources/feeds.rb', line 64 def posts(feed_id, = {}) page = [:page] || 0 per_page = [:per_page] || 10 params = { page: page, per_page: per_page } @client.get("feeds/#{feed_id}/posts", params) end |