Method: AFMotion::SessionClient.build

Defined in:
lib/afmotion/session_client.rb

.build(base_url, &block) ⇒ Object

Returns an instance of AFHTTPRequestOperationManager



22
23
24
25
26
27
28
29
30
31
32
# File 'lib/afmotion/session_client.rb', line 22

def build(base_url, &block)
  dsl = AFMotion::SessionClientDSL.new(base_url)
  case block.arity
  when 0
    dsl.instance_eval(&block)
  when 1
    block.call(dsl)
  end

  dsl.to_session_manager
end