Class: OandaAPI::Client::UsernameClient Deprecated
- Inherits:
-
Object
- Object
- OandaAPI::Client::UsernameClient
- Includes:
- OandaAPI::Client
- Defined in:
- lib/oanda_api/client/username_client.rb
Overview
Please use TokenClient with a practice account instead.
:nocov:
DEPRECATED: The Sandbox API endpoint is no longer supported by Oanda. Makes requests to the API. Instances access the Oanda sandbox environment. Most client requests require a valid Oanda sandbox account username. See the Oanda Development Guide for information about creating a test account.
Constant Summary
Constants included from OandaAPI::Client
Instance Attribute Summary collapse
-
#default_params ⇒ Hash
Parameters that are included with every API request as either query or url_form encoded parameters.
-
#domain ⇒ Symbol
readonly
Identifies the Oanda subdomain (
:sandbox
) which the client accesses. -
#headers ⇒ Hash
Parameters that are included with every API request as HTTP headers.
-
#username ⇒ String
readonly
The username used for authentication.
Instance Method Summary collapse
-
#auth ⇒ Hash
Parameters used for authentication.
-
#initialize(username, options = {}) ⇒ UsernameClient
constructor
A new instance of UsernameClient.
Methods included from OandaAPI::Client
#api_uri, #execute_request, last_request_at, last_request_at=, last_throttled_at, #load_persistent_connection_adapter, map_method_to_http_verb, #proc, throttle_request_rate
Constructor Details
#initialize(username, options = {}) ⇒ UsernameClient
Returns a new instance of UsernameClient.
43 44 45 46 47 48 49 50 |
# File 'lib/oanda_api/client/username_client.rb', line 43 def initialize(username, ={}) warn Kernel.caller.first + " [DEPRECATION] `OandaAPI::Client::UsernameClient` is deprecated. Please use `OandaAPI::Client::TokenClient` instead." super @domain = :sandbox @username = username @default_params = auth @headers = {} end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class OandaAPI::Client
Instance Attribute Details
#default_params ⇒ Hash
Returns parameters that are included with every API request as either query or url_form encoded parameters.
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/oanda_api/client/username_client.rb', line 36 class UsernameClient include Client attr_reader :domain, :username attr_accessor :default_params, :headers # @param [String] username used for authentication. def initialize(username, ={}) warn Kernel.caller.first + " [DEPRECATION] `OandaAPI::Client::UsernameClient` is deprecated. Please use `OandaAPI::Client::TokenClient` instead." super @domain = :sandbox @username = username @default_params = auth @headers = {} end # Parameters used for authentication. # @return [Hash] def auth { "username" => @username } end end |
#domain ⇒ Symbol (readonly)
Returns identifies the Oanda subdomain (:sandbox
) which the
client accesses.
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/oanda_api/client/username_client.rb', line 36 class UsernameClient include Client attr_reader :domain, :username attr_accessor :default_params, :headers # @param [String] username used for authentication. def initialize(username, ={}) warn Kernel.caller.first + " [DEPRECATION] `OandaAPI::Client::UsernameClient` is deprecated. Please use `OandaAPI::Client::TokenClient` instead." super @domain = :sandbox @username = username @default_params = auth @headers = {} end # Parameters used for authentication. # @return [Hash] def auth { "username" => @username } end end |
#headers ⇒ Hash
Returns parameters that are included with every API request as HTTP headers.
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/oanda_api/client/username_client.rb', line 36 class UsernameClient include Client attr_reader :domain, :username attr_accessor :default_params, :headers # @param [String] username used for authentication. def initialize(username, ={}) warn Kernel.caller.first + " [DEPRECATION] `OandaAPI::Client::UsernameClient` is deprecated. Please use `OandaAPI::Client::TokenClient` instead." super @domain = :sandbox @username = username @default_params = auth @headers = {} end # Parameters used for authentication. # @return [Hash] def auth { "username" => @username } end end |
#username ⇒ String (readonly)
Returns the username used for authentication.
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/oanda_api/client/username_client.rb', line 36 class UsernameClient include Client attr_reader :domain, :username attr_accessor :default_params, :headers # @param [String] username used for authentication. def initialize(username, ={}) warn Kernel.caller.first + " [DEPRECATION] `OandaAPI::Client::UsernameClient` is deprecated. Please use `OandaAPI::Client::TokenClient` instead." super @domain = :sandbox @username = username @default_params = auth @headers = {} end # Parameters used for authentication. # @return [Hash] def auth { "username" => @username } end end |
Instance Method Details
#auth ⇒ Hash
Parameters used for authentication.
54 55 56 |
# File 'lib/oanda_api/client/username_client.rb', line 54 def auth { "username" => @username } end |