Module: Restify::Global

Included in:
Restify
Defined in:
lib/restify/global.rb

Instance Method Summary collapse

Instance Method Details

#adapterObject



11
12
13
14
15
# File 'lib/restify/global.rb', line 11

def adapter
  @adapter ||= begin
    Restify::Adapter::Typhoeus.new
  end
end

#adapter=(adapter) ⇒ Object



17
18
19
# File 'lib/restify/global.rb', line 17

def adapter=(adapter)
  @adapter = adapter
end

#cacheObject



21
22
23
24
25
26
27
# File 'lib/restify/global.rb', line 21

def cache
  @cache ||= begin
    require 'active_support'
    require 'active_support/cache'
    Restify::Cache.new store: ActiveSupport::Cache::MemoryStore.new
  end
end

#cache=(cache) ⇒ Object



29
30
31
# File 'lib/restify/global.rb', line 29

def cache=(cache)
  @cache = cache
end

#loggerObject



33
34
35
# File 'lib/restify/global.rb', line 33

def logger
  ::Logging.logger[Restify]
end

#logger=(logger) ⇒ Object



37
# File 'lib/restify/global.rb', line 37

def logger=(logger); end

#new(uri, **opts) ⇒ Object



5
6
7
8
9
# File 'lib/restify/global.rb', line 5

def new(uri, **opts)
  context = resolve_context uri, **opts

  Relation.new context, context.uri
end