Module: Wrest

Defined in:
lib/wrest/uri.rb,
lib/wrest.rb,
lib/wrest/utils.rb,
lib/wrest/native.rb,
lib/wrest_no_ext.rb,
lib/wrest/caching.rb,
lib/wrest/version.rb,
lib/wrest/callback.rb,
lib/wrest/multipart.rb,
lib/wrest/components.rb,
lib/wrest/exceptions.rb,
lib/wrest/http_codes.rb,
lib/wrest/native/get.rb,
lib/wrest/native/put.rb,
lib/wrest/cache_proxy.rb,
lib/wrest/http_shared.rb,
lib/wrest/native/post.rb,
lib/wrest/native/patch.rb,
lib/wrest/uri/builders.rb,
lib/wrest/uri_template.rb,
lib/wrest/async_request.rb,
lib/wrest/caching/redis.rb,
lib/wrest/native/delete.rb,
lib/wrest/native/options.rb,
lib/wrest/native/request.rb,
lib/wrest/native/session.rb,
lib/wrest/native/response.rb,
lib/wrest/caching/memcached.rb,
lib/wrest/native/redirection.rb,
lib/wrest/components/mutators.rb,
lib/wrest/http_shared/headers.rb,
lib/wrest/components/container.rb,
lib/wrest/components/container.rb,
lib/wrest/native/put_multipart.rb,
lib/wrest/test/request_patches.rb,
lib/wrest/native/post_multipart.rb,
lib/wrest/components/translators.rb,
lib/wrest/components/mutators/base.rb,
lib/wrest/async_request/thread_pool.rb,
lib/wrest/core_ext/hash/conversions.rb,
lib/wrest/native/connection_factory.rb,
lib/wrest/components/translators/txt.rb,
lib/wrest/components/translators/xml.rb,
lib/wrest/components/translators/html.rb,
lib/wrest/components/translators/json.rb,
lib/wrest/core_ext/string/conversions.rb,
lib/wrest/http_shared/standard_tokens.rb,
lib/wrest/async_request/thread_backend.rb,
lib/wrest/hash_with_indifferent_access.rb,
lib/wrest/http_shared/standard_headers.rb,
lib/wrest/components/container/typecaster.rb,
lib/wrest/hash_with_case_insensitive_access.rb,
lib/wrest/async_request/event_machine_backend.rb,
lib/wrest/components/mutators/xml_type_caster.rb,
lib/wrest/components/container/alias_accessors.rb,
lib/wrest/components/translators/content_types.rb,
lib/wrest/components/translators/xml/conversions.rb,
lib/wrest/components/mutators/camel_to_snake_case.rb

Overview

Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Defined Under Namespace

Modules: AsyncRequest, Caching, Components, CoreExt, Exceptions, HttpCodes, HttpShared, Multipart, Native, Utils Classes: CacheProxy, Callback, HashWithCaseInsensitiveAccess, HashWithIndifferentAccess, Uri, UriTemplate

Constant Summary collapse

Root =
File.dirname(__FILE__)
Http =

default to using Native libs

Wrest::Native
NoStringExtensions =
true
VERSION =
'4.0.1'
H =

Set up a shorter convenience API for constants

Wrest::HttpShared::StandardHeaders
T =
Wrest::HttpShared::StandardTokens

Class Method Summary collapse

Class Method Details

.enable_evented_requests!Object



36
37
38
# File 'lib/wrest.rb', line 36

def self.enable_evented_requests!
  require 'wrest/event_machine_backend'
end

.loggerObject



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

def self.logger
  @logger
end

.logger=(logger) ⇒ Object



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

def self.logger=(logger)
  @logger = logger
end

.use_native!Object

Switch Wrest to using Net::HTTP.



41
42
43
44
45
46
47
# File 'lib/wrest.rb', line 41

def self.use_native!
  old_verbose = $VERBOSE
  $VERBOSE = nil
  Wrest.const_set('Http', Wrest::Native)
ensure
  $VERBOSE = old_verbose
end