Sha256: d1a6500d0532a48c1fb0236f1b86f786a19c7d500562454966f8b5aa3d3e6cab
Contents?: true
Size: 1.26 KB
Versions: 74
Compression:
Stored size: 1.26 KB
Contents
require 'base64' require 'ably/version' require 'ably/rest/middleware/encoder' require 'ably/rest/middleware/external_exceptions' require 'ably/rest/middleware/fail_if_unsupported_mime_type' require 'ably/rest/middleware/logger' require 'ably/rest/middleware/parse_json' require 'ably/rest/middleware/parse_message_pack' module Ably::Modules # HttpHelpers provides common private methods to classes to simplify HTTP interactions with Ably module HttpHelpers protected def encode64(text) Base64.encode64(text).gsub("\n", '') end def user_agent "Ably Ruby client #{Ably::VERSION} (https://www.ably.io)" end def setup_outgoing_middleware(builder) # Convert request params to "www-form-urlencoded" builder.use Ably::Rest::Middleware::Encoder end def setup_incoming_middleware(builder, logger, options = {}) builder.use Ably::Rest::Middleware::Logger, logger # Parse JSON / MsgPack response bodies. ParseJson must be first (default) parsing middleware if options[:fail_if_unsupported_mime_type] == true builder.use Ably::Rest::Middleware::FailIfUnsupportedMimeType end builder.use Ably::Rest::Middleware::ParseJson builder.use Ably::Rest::Middleware::ParseMessagePack end end end
Version data entries
74 entries across 74 versions & 2 rubygems