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
# File 'lib/restify/global.rb', line 21

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

#cache=(cache) ⇒ Object



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

def cache=(cache)
  @cache = cache
end

#loggerObject



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

def logger
  ::Logging.logger[Restify]
end

#logger=(logger) ⇒ Object



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

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