Class: RetriableX::Client
- Inherits:
-
Object
- Object
- RetriableX::Client
- Defined in:
- lib/retriable_x/client.rb
Overview
X Client
Instance Method Summary collapse
- #follow_check_screenname(screenname) ⇒ Object
-
#initialize(**args) ⇒ Client
constructor
A new instance of Client.
- #me ⇒ Object
Constructor Details
#initialize(**args) ⇒ Client
Returns a new instance of Client.
19 20 21 22 23 24 |
# File 'lib/retriable_x/client.rb', line 19 def initialize(**args) @args = args @try_count = @args[:try_count] || 1 @retry_delay = @args[:retry_delay] || 0 @client = make_client(@args) end |
Instance Method Details
#follow_check_screenname(screenname) ⇒ Object
32 33 34 35 36 37 |
# File 'lib/retriable_x/client.rb', line 32 def follow_check_screenname(screenname) res = execute do |_count| @client.get("users/by/username/#{screenname}?user.fields=connection_status") end follow?(res) end |
#me ⇒ Object
26 27 28 29 30 |
# File 'lib/retriable_x/client.rb', line 26 def me execute do |_count| @client.get("users/me") end end |