Class: FlexmlsApi::Client
- Inherits:
-
Object
- Object
- FlexmlsApi::Client
- Includes:
- Authentication, Connection, Request
- Defined in:
- lib/flexmls_api/client.rb
Overview
API Client
Main class to setup and run requests on the API. A default client is accessible globally as FlexmlsApi::client if the global configuration has been set as well. Otherwise, this class may be instanciated separately with the configuration information.
Instance Attribute Summary collapse
-
#authenticator ⇒ Object
Returns the value of attribute authenticator.
Instance Method Summary collapse
-
#initialize(options = {}, auth_klass = ApiAuth) ⇒ Client
constructor
Constructor bootstraps the client with configuration and authorization class.
Methods included from Request
Methods included from Authentication
#authenticate, #authenticated?, #logout, #session, #session=
Methods included from Connection
Constructor Details
#initialize(options = {}, auth_klass = ApiAuth) ⇒ Client
Constructor bootstraps the client with configuration and authorization class. options - see Configuration::VALID_OPTION_KEYS auth_klass - subclass of Authentication::BaseAuth Defaults to the original api auth system.
17 18 19 20 21 22 23 24 |
# File 'lib/flexmls_api/client.rb', line 17 def initialize(={}, auth_klass=ApiAuth) = FlexmlsApi..merge() Configuration::VALID_OPTION_KEYS.each do |key| send("#{key}=", [key]) end # Instanciate the authenication class passed in. @authenticator = authentication_mode.send("new", self) end |
Instance Attribute Details
#authenticator ⇒ Object
Returns the value of attribute authenticator.
11 12 13 |
# File 'lib/flexmls_api/client.rb', line 11 def authenticator @authenticator end |