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.
16 17 18 19 20 |
# File 'lib/mastodon/client.rb', line 16 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.
11 12 13 |
# File 'lib/mastodon/client.rb', line 11 def base_url @base_url end |
#bearer_token ⇒ Object (readonly)
Returns the value of attribute bearer_token.
11 12 13 |
# File 'lib/mastodon/client.rb', line 11 def bearer_token @bearer_token end |
#timeout ⇒ Object (readonly)
Returns the value of attribute timeout.
11 12 13 |
# File 'lib/mastodon/client.rb', line 11 def timeout @timeout end |