Module: DesignerNews::Client::Stories
- Included in:
- DesignerNews::Client
- Defined in:
- lib/designer_news/client/stories.rb
Instance Method Summary collapse
- #recent_stories(page = 1) ⇒ Object
- #reply_to_story(story_id, comment) ⇒ Object
- #search_stories(query) ⇒ Object
- #stories(page = 1) ⇒ Object
- #story(story_id) ⇒ Object
- #upvote_story(story_id) ⇒ Object
Instance Method Details
#recent_stories(page = 1) ⇒ Object
4 5 6 |
# File 'lib/designer_news/client/stories.rb', line 4 def recent_stories(page=1) get "stories/recent", { page: page } end |
#reply_to_story(story_id, comment) ⇒ Object
20 21 22 |
# File 'lib/designer_news/client/stories.rb', line 20 def reply_to_story(story_id, comment) post "stories/#{story_id}/reply", { comment: { body: comment } } end |
#search_stories(query) ⇒ Object
8 9 10 |
# File 'lib/designer_news/client/stories.rb', line 8 def search_stories(query) get "stories/search", { query: query } end |
#stories(page = 1) ⇒ Object
24 25 26 |
# File 'lib/designer_news/client/stories.rb', line 24 def stories(page=1) get "stories", { page: page } end |
#story(story_id) ⇒ Object
12 13 14 |
# File 'lib/designer_news/client/stories.rb', line 12 def story(story_id) get "stories/#{story_id}" end |
#upvote_story(story_id) ⇒ Object
16 17 18 |
# File 'lib/designer_news/client/stories.rb', line 16 def upvote_story(story_id) post "stories/#{story_id}/upvote" end |