Class: CabbageDoc::Client
- Inherits:
-
Object
- Object
- CabbageDoc::Client
- Includes:
- HTTParty
- Defined in:
- lib/cabbage_doc/client.rb
Class Method Summary collapse
Class Method Details
.new(auth) ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/cabbage_doc/client.rb', line 8 def new(auth) Class.new(self) do |klass| klass.headers "User-Agent" => auth.user_agent klass.base_uri auth.uri if auth.type == :basic klass.basic_auth auth.username, auth.password elsif auth.token klass.headers "Authorization" => "#{auth.type.to_s.capitalize} #{auth.token}" end debug_output $stdout if auth.verbose end end |