Class: Onlyfans::Resources::Users::Block
- Inherits:
-
Object
- Object
- Onlyfans::Resources::Users::Block
- Defined in:
- lib/onlyfans/resources/users/block.rb
Overview
APIs for fetching OnlyFans users
Instance Method Summary collapse
-
#create(user_id, account:, request_options: {}) ⇒ Onlyfans::Models::Users::BlockCreateResponse
Block user from accessing your profile.
-
#delete(user_id, account:, request_options: {}) ⇒ Onlyfans::Models::Users::BlockDeleteResponse
Unblock a previously blocked user.
-
#initialize(client:) ⇒ Block
constructor
private
A new instance of Block.
Constructor Details
#initialize(client:) ⇒ Block
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Block.
65 66 67 |
# File 'lib/onlyfans/resources/users/block.rb', line 65 def initialize(client:) @client = client end |
Instance Method Details
#create(user_id, account:, request_options: {}) ⇒ Onlyfans::Models::Users::BlockCreateResponse
Block user from accessing your profile.
21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/onlyfans/resources/users/block.rb', line 21 def create(user_id, params) parsed, = Onlyfans::Users::BlockCreateParams.dump_request(params) account = parsed.delete(:account) do raise ArgumentError.new("missing required path argument #{_1}") end @client.request( method: :post, path: ["api/%1$s/users/%2$s/block", account, user_id], model: Onlyfans::Models::Users::BlockCreateResponse, options: ) end |
#delete(user_id, account:, request_options: {}) ⇒ Onlyfans::Models::Users::BlockDeleteResponse
Unblock a previously blocked user.
48 49 50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/onlyfans/resources/users/block.rb', line 48 def delete(user_id, params) parsed, = Onlyfans::Users::BlockDeleteParams.dump_request(params) account = parsed.delete(:account) do raise ArgumentError.new("missing required path argument #{_1}") end @client.request( method: :delete, path: ["api/%1$s/users/%2$s/block", account, user_id], model: Onlyfans::Models::Users::BlockDeleteResponse, options: ) end |