Class: FCS::Client
- Inherits:
-
Object
- Object
- FCS::Client
- Defined in:
- lib/fcs/client.rb
Instance Method Summary collapse
- #connect ⇒ Object
-
#initialize(attrs = {}) ⇒ Client
constructor
Initialize a new Client object.
-
#method_missing(method, *args, &block) ⇒ Object
Delgate api call to Request.
Constructor Details
#initialize(attrs = {}) ⇒ Client
Initialize a new Client object
14 15 16 17 18 19 20 21 |
# File 'lib/fcs/client.rb', line 14 def initialize(attrs={}) attrs = FCS..merge(attrs) Config::VALID_OPTIONS_KEYS.each do |key| instance_variable_set("@#{key}".to_sym, attrs[key]) end connect if @auto_connect end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args, &block) ⇒ Object
Delgate api call to Request
32 33 34 35 36 37 |
# File 'lib/fcs/client.rb', line 32 def method_missing(method, *args, &block) klass = class_for_api_command(method) return klass.new(@socket).send(method, *args, &block) if klass super(method, *args, &block) end |