Class: Redd::Models::WikiPage
- Inherits:
-
LazyModel
- Object
- BasicModel
- LazyModel
- Redd::Models::WikiPage
- Defined in:
- lib/redd/models/wiki_page.rb
Overview
A reddit user.
Instance Attribute Summary
Attributes inherited from BasicModel
Instance Method Summary collapse
-
#edit(content, reason: nil) ⇒ Object
Edit the wiki page.
Methods inherited from LazyModel
#force_load, #initialize, #method_missing, #respond_to_missing?, #to_h
Methods inherited from BasicModel
from_id, #initialize, #inspect, #method_missing, #respond_to_missing?, #to_ary, #to_h
Constructor Details
This class inherits a constructor from Redd::Models::LazyModel
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Redd::Models::LazyModel
Instance Method Details
#edit(content, reason: nil) ⇒ Object
Edit the wiki page.
12 13 14 15 16 |
# File 'lib/redd/models/wiki_page.rb', line 12 def edit(content, reason: nil) params = { page: @attributes.fetch(:title), content: content } params[:reason] = reason if reason @client.post("/r/#{@attributes.fetch(:subreddit).display_name}/api/wiki/edit", params) end |