Class: Medium::Posts
- Inherits:
-
Object
- Object
- Medium::Posts
- Defined in:
- lib/medium/posts.rb
Instance Method Summary collapse
-
#create(user, opts) ⇒ Hash
Creates a post on the authenticated user’s profile.
-
#initialize(client) ⇒ Posts
constructor
A new instance of Posts.
Constructor Details
#initialize(client) ⇒ Posts
Returns a new instance of Posts.
3 4 5 |
# File 'lib/medium/posts.rb', line 3 def initialize(client) @client = client end |
Instance Method Details
#create(user, opts) ⇒ Hash
Creates a post on the authenticated user’s profile.
33 34 35 36 |
# File 'lib/medium/posts.rb', line 33 def create(user, opts) @client.post "users/#{user['data']['id']}/posts", build_request_with(opts) end |