Class: FedenaSdk::Client
- Inherits:
-
Object
- Object
- FedenaSdk::Client
- Defined in:
- lib/fedena_sdk/client.rb
Instance Attribute Summary collapse
-
#access_token ⇒ Object
Returns the value of attribute access_token.
-
#client_id ⇒ Object
Returns the value of attribute client_id.
-
#client_secret ⇒ Object
Returns the value of attribute client_secret.
-
#redirect_uri ⇒ Object
Returns the value of attribute redirect_uri.
-
#uri ⇒ Object
Returns the value of attribute uri.
Instance Method Summary collapse
- #authorize_uri ⇒ Object
-
#initialize(options = {}) {|_self| ... } ⇒ Client
constructor
A new instance of Client.
- #method_missing(method, *args) ⇒ Object
- #oauth2_client ⇒ Object
Constructor Details
#initialize(options = {}) {|_self| ... } ⇒ Client
Returns a new instance of Client.
7 8 9 10 11 12 |
# File 'lib/fedena_sdk/client.rb', line 7 def initialize( = {}) .each do |key, value| instance_variable_set("@#{key}", value) end yield(self) if block_given? end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args) ⇒ Object
22 23 24 |
# File 'lib/fedena_sdk/client.rb', line 22 def method_missing(method, *args) oauth2_client.send(method, *args) end |
Instance Attribute Details
#access_token ⇒ Object
Returns the value of attribute access_token.
5 6 7 |
# File 'lib/fedena_sdk/client.rb', line 5 def access_token @access_token end |
#client_id ⇒ Object
Returns the value of attribute client_id.
5 6 7 |
# File 'lib/fedena_sdk/client.rb', line 5 def client_id @client_id end |
#client_secret ⇒ Object
Returns the value of attribute client_secret.
5 6 7 |
# File 'lib/fedena_sdk/client.rb', line 5 def client_secret @client_secret end |
#redirect_uri ⇒ Object
Returns the value of attribute redirect_uri.
5 6 7 |
# File 'lib/fedena_sdk/client.rb', line 5 def redirect_uri @redirect_uri end |
#uri ⇒ Object
Returns the value of attribute uri.
5 6 7 |
# File 'lib/fedena_sdk/client.rb', line 5 def uri @uri end |
Instance Method Details
#authorize_uri ⇒ Object
18 19 20 |
# File 'lib/fedena_sdk/client.rb', line 18 def oauth2_client.auth_code.(redirect_uri: @redirect_uri) end |
#oauth2_client ⇒ Object
14 15 16 |
# File 'lib/fedena_sdk/client.rb', line 14 def oauth2_client @client ||= OAuth2::Client.new(@client_id, @client_secret, site: @uri) end |