module Koala
Constants
- VERSION
Attributes
http_service[RW]
Control which HTTP service framework Koala
uses. Primarily used to switch between the mock-request framework used in testing and the live framework used in real life (and live testing). In theory, you could write your own HTTPService
module if you need different functionality, but since the switch to {github.com/arsduo/koala/wiki/HTTP-Services Faraday} almost all such goals can be accomplished with middleware.
Public Class Methods
config()
click to toggle source
Allows you to control various Koala
configuration options. NOTE: this is not currently threadsafe. See Koala::Configuration
.
# File lib/koala.rb 43 def config 44 @config ||= Configuration.new 45 end
configure() { |config| ... }
click to toggle source
# File lib/koala.rb 36 def configure 37 yield config 38 end
http_service=(service)
click to toggle source
@private Switch the HTTP service – mostly used for testing.
# File lib/koala.rb 55 def self.http_service=(service) 56 # if it's a real http_service, use it 57 @http_service = service 58 end
make_request(path, args, verb, options = {})
click to toggle source
An convenenient alias to Koala.http_service
.make_request.
# File lib/koala.rb 61 def self.make_request(path, args, verb, options = {}) 62 http_service.make_request(HTTPService::Request.new(path: path, args: args, verb: verb, options: options)) 63 end
reset_config()
click to toggle source
Used for testing.
# File lib/koala.rb 48 def reset_config 49 @config = nil 50 end