Class: Coyodlee::Connection

Inherits:
Object
  • Object
show all
Defined in:
lib/coyodlee/connection.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(request_builder) ⇒ Connection

Returns a new instance of Connection.


223
224
225
# File 'lib/coyodlee/connection.rb', line 223

def initialize(request_builder)
  @request_builder = request_builder
end

Class Method Details

.createObject


218
219
220
# File 'lib/coyodlee/connection.rb', line 218

def create
  new RequestBuilder.new(UriBuilder.new(host: Coyodlee.host, cobrand_name: Coyodlee.cobrand_name))
end

Instance Method Details

#start(&block) ⇒ Object


227
228
229
230
231
232
# File 'lib/coyodlee/connection.rb', line 227

def start(&block)
  Net::HTTP.start(@request_builder.host, use_ssl: true) do |http|
    yield RequestFacade.new(http: http,
                            request_builder: @request_builder)
  end
end