Class: TFS::Client
- Inherits:
-
Object
- Object
- TFS::Client
- Extended by:
- ClassHelpers
- Includes:
- Configuration
- Defined in:
- lib/tfs/client.rb
Constant Summary
Constants included from ClassHelpers
TFS::ClassHelpers::SPECIAL_CASES
Constants included from Configuration
TFS::Configuration::CONNECTION_DEFAULTS
Instance Attribute Summary
Attributes included from Configuration
#connection_options, #endpoint, #namespace, #password, #provider, #username
Instance Method Summary collapse
-
#connect ⇒ Object
Creates the connection to the data provider source.
-
#initialize(options = {}) ⇒ Client
constructor
Creates an instance of the client.
- #method_missing(method_name, *args, &block) ⇒ Object
- #run ⇒ Object
Methods included from ClassHelpers
base_class, method_name_from_class, odata_class_from_method_name
Methods included from Configuration
#configure, connection_options, endpoint, keys, namespace, options, password, provider, #reset!, username
Constructor Details
#initialize(options = {}) ⇒ Client
Creates an instance of the client
13 14 15 16 17 |
# File 'lib/tfs/client.rb', line 13 def initialize(={}) TFS::Configuration.keys.each do |key| instance_variable_set(:"@#{key}", [key] || TFS.instance_variable_get(:"@#{key}")) end end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method_name, *args, &block) ⇒ Object
34 35 36 37 |
# File 'lib/tfs/client.rb', line 34 def method_missing(method_name, *args, &block) return super unless @connection.respond_to? method_name @connection.send(method_name, *args, &block) end |
Instance Method Details
#connect ⇒ Object
Creates the connection to the data provider source
20 21 22 |
# File 'lib/tfs/client.rb', line 20 def connect @connection ||= @provider.new endpoint, end |
#run ⇒ Object
30 31 32 |
# File 'lib/tfs/client.rb', line 30 def run @connection.execute end |