class AFMotion::SessionClient

Attributes

shared[RW]

Public Class Methods

build(base_url, &block) click to toggle source

Returns an instance of AFHTTPRequestOperationManager

# File lib/afmotion/session_client.rb, line 24
def build(base_url, &block)
  dsl = AFMotion::SessionClientDSL.new(base_url)
  
  if block_given?
    case block.arity
    when 0
      dsl.instance_eval(&block)
    when 1
      block.call(dsl)
    end  
  end
  
  dsl.to_session_manager
end
build_shared(base_url, &block) click to toggle source

Sets AFMotion::Client.shared as the built client

# File lib/afmotion/session_client.rb, line 40
def build_shared(base_url, &block)
  self.shared = self.build(base_url, &block)
end