Class: Mastodon::Client
- Inherits:
-
Object
- Object
- Mastodon::Client
- Defined in:
- lib/mastodon/client.rb
Direct Known Subclasses
Constant Summary collapse
- DEFAULT_TIMEOUT =
{ connect: 2, read: 5, write: 20 }.freeze
Instance Attribute Summary collapse
-
#base_url ⇒ Object
readonly
Returns the value of attribute base_url.
-
#bearer_token ⇒ Object
readonly
Returns the value of attribute bearer_token.
-
#timeout ⇒ Object
readonly
Returns the value of attribute timeout.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Client
constructor
A new instance of Client.
-
#user_agent ⇒ String
User agent of the client.
Constructor Details
#initialize(options = {}) ⇒ Client
Returns a new instance of Client.
20 21 22 23 24 |
# File 'lib/mastodon/client.rb', line 20 def initialize( = {}) @base_url = [:base_url] @bearer_token = [:bearer_token] @timeout = DEFAULT_TIMEOUT.merge([:timeout] || {}) end |
Instance Attribute Details
#base_url ⇒ Object (readonly)
Returns the value of attribute base_url.
13 14 15 |
# File 'lib/mastodon/client.rb', line 13 def base_url @base_url end |
#bearer_token ⇒ Object (readonly)
Returns the value of attribute bearer_token.
13 14 15 |
# File 'lib/mastodon/client.rb', line 13 def bearer_token @bearer_token end |
#timeout ⇒ Object (readonly)
Returns the value of attribute timeout.
13 14 15 |
# File 'lib/mastodon/client.rb', line 13 def timeout @timeout end |