Class: AFMotion::SessionClient

Inherits:
Object
  • Object
show all
Defined in:
lib/afmotion/session_client.rb

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.sharedObject

Returns the value of attribute shared


19
20
21
# File 'lib/afmotion/session_client.rb', line 19

def shared
  @shared
end

Class Method Details

.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

.build_shared(base_url, &block) ⇒ Object

Sets AFMotion::Client.shared as the built client


35
36
37
# File 'lib/afmotion/session_client.rb', line 35

def build_shared(base_url, &block)
  self.shared = self.build(base_url, &block)
end