Module: Restify::Global
- Included in:
- Restify
- Defined in:
- lib/restify/global.rb
Instance Method Summary collapse
- #adapter ⇒ Object
- #adapter=(adapter) ⇒ Object
- #cache ⇒ Object
- #cache=(cache) ⇒ Object
- #logger ⇒ Object
- #logger=(logger) ⇒ Object
- #new(uri, **opts) ⇒ Object
Instance Method Details
#adapter ⇒ Object
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 |
#cache ⇒ Object
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 |
#logger ⇒ Object
32 33 34 |
# File 'lib/restify/global.rb', line 32 def logger ::Logging.logger[Restify] end |
#logger=(logger) ⇒ Object
36 37 38 |
# 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 |