Class: InstagramBasicDisplay::Client
- Inherits:
-
Object
- Object
- InstagramBasicDisplay::Client
- Extended by:
- Forwardable
- Defined in:
- lib/instagram_basic_display/client.rb
Overview
Exposes all the functionality of the gem, so that you can interact with the Instagram API. Methods are defined in separate modules, but delegated here for simplicity when interacting with the gem.
Instance Method Summary collapse
-
#configuration ⇒ InstagramBasicDisplay::Configuration
Configuration that will be used to make requests against the Instagram API: redirect_uri, client secret, and client ID.
-
#configure {|configuration| ... } ⇒ Object
Sets the gem’s configuration.
-
#initialize(auth_token: nil, version: 1) ⇒ Object
constructor
Constructor method.
Constructor Details
#initialize(auth_token: nil, version: 1) ⇒ Object
Constructor method
make requests. If you do not have a token, you can retrieve one by using the authentication utilities provided.
38 39 40 41 42 43 44 |
# File 'lib/instagram_basic_display/client.rb', line 38 def initialize(auth_token: nil, version: 1) @auth_token = auth_token @version = version @auth = Auth.new(configuration) @profile = Profile.new(configuration) end |
Instance Method Details
#configuration ⇒ InstagramBasicDisplay::Configuration
Configuration that will be used to make requests against the Instagram API: redirect_uri, client secret, and client ID. These are automatically picked up from environment variables. Optionally, you can pass an auth token which will be used to make requests.
52 53 54 |
# File 'lib/instagram_basic_display/client.rb', line 52 def configuration @configuration ||= InstagramBasicDisplay::Configuration.new(auth_token: @auth_token, version: @version) end |
#configure {|configuration| ... } ⇒ Object
Sets the gem’s configuration
59 60 61 62 |
# File 'lib/instagram_basic_display/client.rb', line 59 def configure yield(configuration) if block_given? nil end |