Class: Jimson::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/jimson/client.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(url) ⇒ Client

Returns a new instance of Client.



157
158
159
# File 'lib/jimson/client.rb', line 157

def initialize(url)
  @helper = ClientHelper.new(url)
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(sym, *args, &block) ⇒ Object



161
162
163
# File 'lib/jimson/client.rb', line 161

def method_missing(sym, *args, &block)
  @helper.process_call(sym, args) 
end

Class Method Details

.batch(client) {|batch_client| ... } ⇒ Object

Yields:

  • (batch_client)


150
151
152
153
154
155
# File 'lib/jimson/client.rb', line 150

def self.batch(client)
  helper = client.instance_variable_get(:@helper)
  batch_client = BatchClient.new(helper)
  yield batch_client
  helper.send_batch
end