Class: ApiPattern::Client
- Inherits:
-
Object
- Object
- ApiPattern::Client
- Includes:
- Constants
- Defined in:
- lib/api-pattern/client.rb
Constant Summary
Constants included from Constants
ApiPattern::Constants::AUTH_TYPES, ApiPattern::Constants::BASE_PORT, ApiPattern::Constants::DEFAULT_AUTH_TYPE, ApiPattern::Constants::EMPTY_AUTH, ApiPattern::Constants::EMPTY_PARAMETER
Instance Attribute Summary collapse
-
#auth ⇒ Object
readonly
Other auth parameters may be removed in the future For now making sure this base is compatible with all my API clients.
-
#auth_type ⇒ Object
readonly
Other auth parameters may be removed in the future For now making sure this base is compatible with all my API clients.
-
#base_path ⇒ Object
readonly
Returns the value of attribute base_path.
-
#content_type ⇒ Object
readonly
Returns the value of attribute content_type.
-
#expiry ⇒ Object
readonly
Response instance variables.
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#limit ⇒ Object
readonly
Returns the value of attribute limit.
-
#login_response ⇒ Object
readonly
Response instance variables.
-
#password ⇒ Object
readonly
Returns the value of attribute password.
-
#port ⇒ Object
readonly
Returns the value of attribute port.
-
#raw_cookie ⇒ Object
readonly
Response instance variables.
-
#secret ⇒ Object
readonly
Returns the value of attribute secret.
-
#token ⇒ Object
readonly
Returns the value of attribute token.
-
#username ⇒ Object
readonly
Returns the value of attribute username.
Class Method Summary collapse
-
.api_version ⇒ Object
This is the version of the API docs this client was built off-of.
- .compatible_api_version ⇒ Object
Instance Method Summary collapse
-
#initialize(base_path:, content_type:, port: BASE_PORT, auth: EMPTY_AUTH, auth_type: DEFAULT_AUTH_TYPE, token: EMPTY_PARAMETER, api_token: EMPTY_PARAMETER, access_token: EMPTY_PARAMETER, username: EMPTY_PARAMETER, key: EMPTY_PARAMETER, password: EMPTY_PARAMETER, secret: EMPTY_PARAMETER, limit: EMPTY_PARAMETER) ⇒ Client
constructor
A new instance of Client.
Constructor Details
#initialize(base_path:, content_type:, port: BASE_PORT, auth: EMPTY_AUTH, auth_type: DEFAULT_AUTH_TYPE, token: EMPTY_PARAMETER, api_token: EMPTY_PARAMETER, access_token: EMPTY_PARAMETER, username: EMPTY_PARAMETER, key: EMPTY_PARAMETER, password: EMPTY_PARAMETER, secret: EMPTY_PARAMETER, limit: EMPTY_PARAMETER) ⇒ Client
Returns a new instance of Client.
17 18 19 20 21 22 23 24 |
# File 'lib/api-pattern/client.rb', line 17 def initialize(base_path:, content_type:, port: BASE_PORT, auth: EMPTY_AUTH, auth_type: DEFAULT_AUTH_TYPE, token: EMPTY_PARAMETER, api_token: EMPTY_PARAMETER, access_token: EMPTY_PARAMETER, username: EMPTY_PARAMETER, key: EMPTY_PARAMETER, password: EMPTY_PARAMETER, secret: EMPTY_PARAMETER, limit: EMPTY_PARAMETER) process_auth(auth, auth_type, token, api_token, access_token, username, key, password, secret) @content_type = content_type @base_path = base_path @port = port @limit = limit end |
Instance Attribute Details
#auth ⇒ Object (readonly)
Other auth parameters may be removed in the future For now making sure this base is compatible with all my API clients
9 10 11 |
# File 'lib/api-pattern/client.rb', line 9 def auth @auth end |
#auth_type ⇒ Object (readonly)
Other auth parameters may be removed in the future For now making sure this base is compatible with all my API clients
9 10 11 |
# File 'lib/api-pattern/client.rb', line 9 def auth_type @auth_type end |
#base_path ⇒ Object (readonly)
Returns the value of attribute base_path.
5 6 7 |
# File 'lib/api-pattern/client.rb', line 5 def base_path @base_path end |
#content_type ⇒ Object (readonly)
Returns the value of attribute content_type.
5 6 7 |
# File 'lib/api-pattern/client.rb', line 5 def content_type @content_type end |
#expiry ⇒ Object (readonly)
Response instance variables
15 16 17 |
# File 'lib/api-pattern/client.rb', line 15 def expiry @expiry end |
#key ⇒ Object (readonly)
Returns the value of attribute key.
11 12 13 |
# File 'lib/api-pattern/client.rb', line 11 def key @key end |
#limit ⇒ Object (readonly)
Returns the value of attribute limit.
5 6 7 |
# File 'lib/api-pattern/client.rb', line 5 def limit @limit end |
#login_response ⇒ Object (readonly)
Response instance variables
15 16 17 |
# File 'lib/api-pattern/client.rb', line 15 def login_response @login_response end |
#password ⇒ Object (readonly)
Returns the value of attribute password.
12 13 14 |
# File 'lib/api-pattern/client.rb', line 12 def password @password end |
#port ⇒ Object (readonly)
Returns the value of attribute port.
5 6 7 |
# File 'lib/api-pattern/client.rb', line 5 def port @port end |
#raw_cookie ⇒ Object (readonly)
Response instance variables
15 16 17 |
# File 'lib/api-pattern/client.rb', line 15 def @raw_cookie end |
#secret ⇒ Object (readonly)
Returns the value of attribute secret.
12 13 14 |
# File 'lib/api-pattern/client.rb', line 12 def secret @secret end |
#token ⇒ Object (readonly)
Returns the value of attribute token.
10 11 12 |
# File 'lib/api-pattern/client.rb', line 10 def token @token end |
#username ⇒ Object (readonly)
Returns the value of attribute username.
11 12 13 |
# File 'lib/api-pattern/client.rb', line 11 def username @username end |
Class Method Details
.api_version ⇒ Object
This is the version of the API docs this client was built off-of
31 32 33 |
# File 'lib/api-pattern/client.rb', line 31 def self.api_version raise NotImplementedError end |
.compatible_api_version ⇒ Object
26 27 28 |
# File 'lib/api-pattern/client.rb', line 26 def self.compatible_api_version raise NotImplementedError end |