Class: Queued::Client
- Inherits:
-
Object
- Object
- Queued::Client
- Defined in:
- lib/queued/client.rb
Instance Method Summary collapse
-
#initialize(url, options = {}) ⇒ Client
constructor
A new instance of Client.
- #queue(name) ⇒ Object
Constructor Details
#initialize(url, options = {}) ⇒ Client
Returns a new instance of Client.
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/queued/client.rb', line 6 def initialize(url, = {}) @url = url @auth = [:auth] @conn = Faraday.new(:url => @url) do |conn| conn.use Middleware::Errors conn.request :json conn.response :json, :content_type => /\bjson$/ conn.adapter Faraday.default_adapter end if @auth @conn.basic_auth('', @auth) end end |