Class: SocialstatsSDK::Client
- Inherits:
-
Object
- Object
- SocialstatsSDK::Client
- Defined in:
- lib/socialstats_sdk/client.rb
Instance Attribute Summary collapse
-
#creators ⇒ Object
readonly
Returns the value of attribute creators.
-
#info ⇒ Object
readonly
Returns the value of attribute info.
-
#posts ⇒ Object
readonly
Returns the value of attribute posts.
Instance Method Summary collapse
- #close ⇒ Object
-
#initialize(api_key:, base_url: HTTPClient::DEFAULT_BASE_URL, timeout: HTTPClient::DEFAULT_TIMEOUT_SECONDS, max_retries: 2, http_adapter: nil, user_agent: nil) ⇒ Client
constructor
A new instance of Client.
Constructor Details
#initialize(api_key:, base_url: HTTPClient::DEFAULT_BASE_URL, timeout: HTTPClient::DEFAULT_TIMEOUT_SECONDS, max_retries: 2, http_adapter: nil, user_agent: nil) ⇒ Client
Returns a new instance of Client.
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/socialstats_sdk/client.rb', line 7 def initialize(api_key:, base_url: HTTPClient::DEFAULT_BASE_URL, timeout: HTTPClient::DEFAULT_TIMEOUT_SECONDS, max_retries: 2, http_adapter: nil, user_agent: nil) @http = HTTPClient.new( api_key: api_key, base_url: base_url, timeout: timeout, max_retries: max_retries, adapter: http_adapter, user_agent: user_agent ) @info = Resources::Info.new(@http) @creators = Resources::Creators.new(@http) @posts = Resources::Posts.new(@http) end |
Instance Attribute Details
#creators ⇒ Object (readonly)
Returns the value of attribute creators.
5 6 7 |
# File 'lib/socialstats_sdk/client.rb', line 5 def creators @creators end |
#info ⇒ Object (readonly)
Returns the value of attribute info.
5 6 7 |
# File 'lib/socialstats_sdk/client.rb', line 5 def info @info end |
#posts ⇒ Object (readonly)
Returns the value of attribute posts.
5 6 7 |
# File 'lib/socialstats_sdk/client.rb', line 5 def posts @posts end |
Instance Method Details
#close ⇒ Object
23 24 25 |
# File 'lib/socialstats_sdk/client.rb', line 23 def close @http.close end |